You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chore(ingest-types): sync from cloud@9d3282f6 and fix the type fallout - #23404
Do not merge yet. Ready for review, not for merge. Merge only after the Cloud release that contains Comfy-Org/cloud#19173 and Comfy-Org/cloud#19175 is running on staging and production. On Cloud main today the ingest image is pinned to v0.546.15 for both comfy-cloud-stg-v2 and comfy-cloud-prod-v2, and that tag contains neither PR; only comfy-cloud-test-v2 (9d3282f) has them. The staging frontend follows this repo's main, so merging earlier would make the billing capabilities and auto top-up reads fail on staging, where After M4 QA is running. Checked from the repo's overlay values, not from the live cluster.
Summary
The bot sync #23331 is red. Its regenerated types make three response fields required, and the fixtures that build those responses no longer typecheck. We need the sync for GET /api/billing/ops/{id}/outcome (BillingOpOutcomeResponse, Comfy-Org/cloud#19213), which the billing-web follow-up for FRONT-3855 reads.
This PR takes the bot's generated files unchanged (update-ingest-types at d4a238c, cloud@9d3282f6) on top of main and fixes the fallout.
graph LR
A["Comfy-Org/cloud#19213<br/>billing op outcome route, merged"] --> B["This PR<br/>ingest-types sync"]
B --> C["billing-web follow-up for FRONT-3855<br/>reads the outcome route, not opened yet"]
D["Comfy-Org/cloud#19173 and #19175<br/>new required fields, merged, deploy first"] -.-> B
style B fill:#2563eb,color:#fff
Loading
What the sync brings
New route: GET /api/billing/ops/{id}/outcome with BillingOpOutcomeResponse (status is pending, succeeded, failed or reconciliation_needed) and zGetBillingOpOutcomeResponse.
Removed route: GET /api/v1/catalog/docs (GetCatalogDocs*). Nothing in the repo imports it.
New required fields: BillingCapabilities.can_set_budgets and can_set_hard_caps (cloud#19173), auto_top_up_conflict on AutoReloadSettings, BudgetList and BudgetWriteResult (cloud#19175), and CccPageRow.on_desktop. Nothing in the repo builds or reads BudgetList, BudgetWriteResult or CccPageRow.
Enum change: denied_reasons gains the keys can_set_budgets and can_set_hard_caps, and with them one new reason, plan_not_enterprise.
New error types: GetCatalogAgentInstructionsError and GetCatalogOpenApiError (400, 401 and 403 added).
Doc-only changes on BillingOpStatusResponse and SubscribeRequest.
Fallout fixed
Files
What was missing
Value and reason
21 BillingCapabilities literals in 20 fixture, mock and test files under src/platform/{auth,billing}, packages/account-core, packages/account-ui, apps/billing-web and browser_tests
can_set_budgets, can_set_hard_caps
false for both. Ingest serves false when billing-api omits the field, and no code reads either one.
12 AutoReloadSettings literals under src/platform/billing, packages/account-core, packages/account-ui and browser_tests
auto_top_up_conflict
false, which the spec reads as "show no warning". The schema is z.boolean(), not nullable.
billingCapabilities.contract.test.ts
the two capability keys in the pinned type
Added, so the pinned shape equals the generated one.
Some of these fixtures are untyped wire bodies that the Zod readers parse, so they fail at run time and not at typecheck. With main's fixtures, 79 tests fail in four account-core files (capabilities, topup, scopedReader, autoTopUp), and the billing-web browser specs fail because the order summary never renders. #23331 did not show this: its unit job was skipped behind the typecheck failure, and its billing-web-e2e job was cancelled at the 20-minute limit.
Production code has two changes:
packages/account-core/src/core/billing/capabilityDenials.ts: CapabilityDenialReason and KNOWN_REASONS gain plan_not_enterprise. The contract test requires the client union to equal the server union.
apps/billing-web/src/checkout/endingScreen.ts: REFUSAL_COPY maps plan_not_enterprise to unknown, the generic copy. The record is exhaustive over the union, so it needs the key.
No user-visible change
No code reads the new fields or calls the new route. Cloud sends plan_not_enterprise only under denied_reasons.can_set_hard_caps, which nothing reads. Before this PR the reason decoded as unspecified, which billing web also shows with the generic copy. There is nothing to screenshot.
One condition applies. The generated Zod makes the three fields required, and the SDK readers parse with it (capabilities: zBillingCapabilities in capabilities.ts, zGetBillingAutoReloadResponse in autoTopUp.ts). An ingest that does not send the fields fails those reads, and billing-web checkout does not render. Cloud main includes cloud#19173 and cloud#19175, both merged on 2026-11-13. The latest Cloud release tag, v0.546.15, predates both. Deploy ingest with those two changes before a frontend that contains this sync reaches users. #22913 carried the same condition for its two capability fields.
Feature gate
Types and test data only. No behavior changes behind or outside any flag.
Verification
Pre-commit hook: oxfmt, oxlint, eslint, lint:server-facts, typecheck:app, typecheck:browser, typecheck:billing-web, typecheck:account-core and typecheck:account-ui pass. The pre-push hook (deps:audit, knip, check:generated) passes.
Vitest: account-core src/core/billing 1373/1373, account-ui src/billing 406/406, billing-web 1655/1655, app src/platform/billing with the web-session and billing-tab tests 4713/4713.
Playwright, local: billing-web checkout.spec.ts and full-page-topup.spec.ts 31/31. Without the two capability fields in the e2e fixture, full-page-topup.spec.ts fails.
The generated files equal the bot branch: git diff origin/update-ingest-types HEAD -- packages/ingest-types is empty.
Take the generated output of the bot sync (update-ingest-types at
d4a238c) unchanged. It adds GET /api/billing/ops/{id}/outcome
(BillingOpOutcomeResponse) and makes three response fields required:
capabilities.can_set_budgets, capabilities.can_set_hard_caps, and
auto_top_up_conflict on the auto top-up settings.
Fixtures and mocks that build those responses gain the new fields as
false, the value ingest serves when billing-api omits them. No code
reads them yet.
CapabilityDenialReason gains plan_not_enterprise, the one new denial
reason, so the client union equals the server union again. Billing web
maps it to the generic refusal copy, which an unrecognized reason
already gets.
🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measure
No verdict is available. Open the workflow run to confirm the check was intentionally skipped, or fix the collection failure and re-run it.
Findings and check details
Executes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight ecosystem-matrix shard checks are a harness self-test; the pack verdict is matrix-verdict.
The matrix runs on same-repository version-bump PRs with relevant changes, main-branch pushes, and manual dispatches. This candidate does not qualify, so every expensive stage was skipped.
# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
🌾 Fallow: ✅ Passed
Findings and check details
Fallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened.
# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since f1974bcc949712332d13366ac11d0b8a035f6f51
🏛️ Architecture: ✅ Passed
Findings and check details
Warnings (515)
billing path matches no source files: src/platform/billing/composables/activateBillingScope.testUtils.ts. Remove or update it in docs/architecture/domains/records/billing.domain.json.
error-handling path matches no source files: src/utils/errorUtil.ts. Remove or update it in docs/architecture/domains/records/error-handling.domain.json.
graph-model path matches no source files: src/types/linkTopology.ts. Remove or update it in docs/architecture/domains/records/graph-model.domain.json.
graph-model path matches no source files: src/types/nodeState.ts. Remove or update it in docs/architecture/domains/records/graph-model.domain.json.
job-queue path matches no source files: src/platform/remote/comfyui/jobs/**. Remove or update it in docs/architecture/domains/records/job-queue.domain.json.
linear-mode path matches no source files: src/utils/appMode.ts. Remove or update it in docs/architecture/domains/records/linear-mode.domain.json.
link-connection path matches no source files: src/lib/litegraph/src/infrastructure/LinkConnectorEventMap.ts. Remove or update it in docs/architecture/domains/records/link-connection.domain.json.
node-widgets path matches no source files: src/types/widgetState.ts. Remove or update it in docs/architecture/domains/records/node-widgets.domain.json.
subgraphs path matches no source files: src/lib/litegraph/src/infrastructure/SubgraphEventMap.ts. Remove or update it in docs/architecture/domains/records/subgraphs.domain.json.
vue-node-widgets path matches no source files: src/types/positionConfig.ts. Remove or update it in docs/architecture/domains/records/vue-node-widgets.domain.json.
workspace path matches no source files: src/platform/workspace/fixtures/**. Remove or update it in docs/architecture/domains/records/workspace.domain.json.
packages/api-client/src/abortSignal.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/api-client/src/abortSignal.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/api-client/src/fetchRouteTemplate.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/api-client/src/fetchWithRetry.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/api-client/src/fetchWithRetry.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/api-client/src/retryPolicy.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/api-client/src/retryPolicy.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/api-client/src/statusRetryTelemetry.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/api-client/src/statusRetryTelemetry.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/comfyui-api-types/src/generated/index.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/comfyui-api-types/src/generated/types.gen.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/comfyui-api-types/src/index.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/shared-frontend-utils/src/formatUtil.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/shared-frontend-utils/src/formatUtil.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/shared-frontend-utils/src/geometry.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/shared-frontend-utils/src/loadExternalScript.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/shared-frontend-utils/src/networkUtil.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/shared-frontend-utils/src/telemetry.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/shared-frontend-utils/src/telemetry.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/shared-frontend-utils/src/urlSafety.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/shared-frontend-utils/src/urlSafety.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/tailwind-utils/src/index.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/TopbarActions.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/searchbox/v2/filterChip.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/videoConcat/VideoConcatClipStrip.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/videoConcat/VideoConcatClipTile.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/videoConcat/VideoConcatPanel.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/videoConcat/VideoConcatPanel.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/videoConcat/VideoConcatPlaybackBar.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/videoConcat/WidgetVideoConcat.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/videoConcat/WidgetVideoConcat.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/videoConcat/__fixtures__/clipTiles.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/widgetHistory/WidgetHistoryButtons.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/widgetHistory/WidgetHistoryButtons.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/composables/graph/menuOption.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/composables/useAgentExtensionActions.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/composables/useAgentExtensionActions.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/composables/useAgentExtensionNotices.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/composables/useAgentExtensionNotices.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
Reviewing files that changed from the base of the PR and between 9ede43a and 9ede43a.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The pull request updates generated billing and catalog API contracts. It adds billing capability, auto-top-up, and operation outcome fields, updates denial-reason handling, revises catalog endpoint declarations, and aligns related test and mock fixtures.
Changes: Billing contracts and fixtures
Layer / File(s)
Summary
Billing capability and auto-top-up shapes packages/ingest-types/src/types.gen.ts, packages/ingest-types/src/zod.gen.ts, packages/account-core/src/core/billing/contracts/billingCapabilities.contract.test.ts
Generated types and schemas add can_set_budgets, can_set_hard_caps, and auto_top_up_conflict. Capability denial unions and budget error descriptions include plan-refusal reasons. Contract tests include the new capability fields.
The denial decoder recognizes plan_not_enterprise. Checkout maps this refusal reason to the unknown copy classification.
Billing operation outcomes and plan-change authentication packages/ingest-types/src/index.ts, packages/ingest-types/src/types.gen.ts, packages/ingest-types/src/zod.gen.ts
Generated declarations add GET /api/billing/ops/{id}/outcome and its outcome status schema. Subscription descriptions cover SetupIntent authentication and payment-method behavior for plan changes.
Catalog agent-instructions and OpenAPI declarations add workspace-selection, authentication, and authorization errors. Their response comments identify private no-store behavior. The generated catalog docs response declarations and exports are removed.
Desktop surface field packages/ingest-types/src/types.gen.ts, packages/ingest-types/src/zod.gen.ts
The generated CccPageRow type and schema add the required on_desktop field.
This PR syncs generated billing types and makes several new response fields required. If it merges before the matching Cloud release is live, billing reads that lack those fields will fail. Hold the merge until the Cloud release is deployed to staging and production.
Pre-merge checks: 7
Check name
Status
Explanation
Title check
The title 'chore(ingest-types): sync from cloud@9d3282f6 and fix the type fallout' names the main change: syncing generated ingest types from a cloud commit and fixing the resulting type errors. The c…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description is thorough and matches the template's core sections. It has a Summary that explains the problem (bot sync #23331 red after regenerated types make three response fields required) and t…
Description check
The PR description follows the repository template closely. It has the required Summary and Verification sections, with more detail than the template asks for. Two optional items are absent: an issue …
End-To-End Test Suggestion For User-Facing Changes
The check passes. It does not apply here, or no user-triggerable behavior changes. Evidence from the PR metadata and diff summary: - Most of the diff is generated types and test or fixture data. This …
Adr Compliance For Entity/Litegraph Changes
The check applies only when the PR changes files under src/lib/litegraph/, src/ecs/, or files related to graph entities (nodes, links, widgets, slots, reroutes, groups, subgraphs). The changed-fil…
Full details: Title check
Explanation
The title 'chore(ingest-types): sync from cloud@9d3282f6 and fix the type fallout' names the main change: syncing generated ingest types from a cloud commit and fixing the resulting type errors. The changeset matches this: regenerated ingest-types files plus fixture and literal fixes across billing packages.
Full details: Description check
Explanation
The description is thorough and matches the template's core sections. It has a Summary that explains the problem (bot sync #23331 red after regenerated types make three response fields required) and the resulting change, and it names the superseded PR. It has a Verification section with lint and typecheck hooks, Vitest and Playwright results, and a note on the e2e fixture. It also includes a deploy-ordering warning and a feature-gate note. The template's 'Fixes #ISSUE' line is optional and is not present, and no After-release telemetry is listed. Those are non-critical gaps.
Full details: Description check
Explanation
The PR description follows the repository template closely. It has the required Summary and Verification sections, with more detail than the template asks for. Two optional items are absent: an issue reference line, which is commented out in the template, and any After-release logs or metrics. Neither is critical to the review.
Full details: End-To-End Test Suggestion For User-Facing Changes
Explanation
The check passes. It does not apply here, or no user-triggerable behavior changes. Evidence from the PR metadata and diff summary: - Most of the diff is generated types and test or fixture data. This covers packages/ingest-types/src/*.gen.ts, index.ts, and many *.test.ts, __mocks__, and __fixtures__ files. Those are tests and tooling, so they are out of scope. - Two production changes exist under src/, packages/, or apps/: - packages/account-core/src/core/billing/capabilityDenials.ts adds plan_not_enterprise to CapabilityDenialReason and KNOWN_REASONS. The summary says this lets the decoder recognize a reason it currently maps to unspecified. - apps/billing-web/src/checkout/endingScreen.ts maps plan_not_enterprise to the generic unknown copy. The PR states that unspecified already shows the same generic copy. - The PR description states that no code reads the new fields. It also states that no code calls the new GET /api/billing/ops/{id}/outcome route. - Cloud sends plan_not_enterprise only under denied_reasons.can_set_hard_caps. Nothing in the frontend reads that key. Criterion 2 therefore fails: no plain-language user action produces a visible change. The reason is reachable only through server payloads the frontend does not consume. - The PR does not add a user-visible feature or fix a user-visible bug. The checkout display is unchanged in practice. Criterion 2 is not met, so the check does not fail. No Playwright test is suggested. The check encourages tests and never requires them. Note: this verdict relies on the PR summary and description. I did not run shell commands, per the check's rule for this criterion.
Full details: Adr Compliance For Entity/Litegraph Changes
Explanation
The check applies only when the PR changes files under src/lib/litegraph/, src/ecs/, or files related to graph entities (nodes, links, widgets, slots, reroutes, groups, subgraphs). The changed-file list in the raw summary contains none of these paths. The changed files are: - apps/billing-web/ (e2e fixture, endingScreen, billingWebClient test) - browser_tests/fixtures/data/ (autoTopUpAtCheckout, billingCapabilities) - packages/account-core/ and packages/account-ui/ (billing fixtures, capabilityDenials, contract tests) - packages/ingest-types/ (generated index.ts, types.gen.ts, zod.gen.ts) - src/platform/auth/ and src/platform/billing/ (billing API mocks, composables, SDK and telemetry tests) These are billing types, fixtures, mocks, and tests. None of them is a litegraph, ECS, or graph-entity file. The check's pass condition therefore applies, and I did not evaluate the four ADR patterns. The PR description also states that no runtime behavior changes. Per the check's instructions, I did not run shell commands.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.
Rollout: read staging and production /api/billing/capabilities and /api/billing/auto-reload responses to establish that the required fields are deployed.
Contract: exact bot-sync identity (git diff d4a238ccc7 HEAD -- packages/ingest-types).
Checked: Read, not run: changed contracts against cloud@9d3282f6; head/base response parsing and denial-copy paths; readers of added fields and removed exports.
~1.5M effective tokens for this review (9.6M raw; cache reads weighted 0.1x, cache writes 1.25-2x)
The reason will be displayed to describe this comment to others. Learn more.
No new blocking code finding established. Verified through GitHub blob SHAs that all three generated files exactly match d4a238c. Inspected the required-field fixture updates, denial normalization and exhaustive refusal-copy mapping. No handwritten response contract or client-derived permission introduced. The documented Cloud deploy-first prerequisite still applies: do not merge until the required fields are served on staging and production. I have not verified live deployments. The do-not-merge check is failing; other completed checks show no additional failure.
No tests, lint, builds or workflows run, as requested. This is a COMMENT review because the authenticated account is also the PR author, dante01yoon; GitHub prohibits self-approval and self-request-changes. Retaining dante01yoon preserves the requested author assignment; other assignees are preserved.
… payment resolves (Comfy-Org#23405)
> **Stacked on Comfy-Org#23404.** Comfy-Org#23404 (ingest-types sync) is the base branch.
It carries `zGetBillingOpOutcomeResponse`. Do not merge into `main`
before the Cloud release that Comfy-Org#23404 names. Comfy-Org#23395 (designed ending
screens) is merged, and this branch has it through the base, so the diff
shows only this PR.
## Dependency graph
```mermaid
graph LR
A["cloud PR 19213 (merged): read one operation's outcome after the session expires"] --> B["ingest-types sync, PR 23404 (open, draft)"]
B --> D["Checking your payment updates itself (this PR)"]
C["every handoff session ends on a designed screen, PR 23395 (merged)"] --> D
style D stroke-width:3px
```
Part of FRONT-3855.
## Summary
**Why.** DES-1310 / FRONT-3855 describes "Checking your payment" as the
screen that "updates itself when the payment resolves". The screen was
static. It told the customer "If this page still can't confirm it after
a few minutes, contact support with this code", and the page never tried
to confirm anything.
**Root cause.** A handoff tab that ended on an unsettled payment kept
the operation id and no credential (`endingFrom` in
`handoff/handoffTab.ts`), and no Cloud route accepted a scoped session
after it ended. Comfy-Org/cloud#19213 added `GET
/api/billing/ops/{id}/outcome`. Cloud authenticates it with the
scoped-session bearer alone and also accepts a session that expired less
than 30 minutes ago.
**How.**
- **The ended state keeps what the read needs.** `HandoffState` gains
`CheckingPayment` (`handoff/paymentOutcome.ts`): the `payment_pending`
ending with the operation id, the workspace name, the bearer, and
`since`, the moment the tab ended the session. `endingFrom` stays the
one place that picks an ending at session end, and it fills those four
from the live session. No other ending has a `token` field.
- **The reader is in account-core, next to the other billing readers.**
`readOperationOutcome` in
`packages/account-core/src/core/billing/operationOutcome.ts` takes the
bearer and the operation id and builds the route itself
(`operationOutcomeRoute`), so the bearer cannot reach another route
through it. The request carries `credentials: 'omit'`. It parses the
body with `zGetBillingOpOutcomeResponse` and derives the status type
from that schema. It returns one of three values: the status Cloud
reports, `refused` (401, 403, 404), or `unknown` (network error,
timeout, 5xx, a body it cannot read).
- **The poll reuses the operation lifecycle's cadence.**
`followPaymentOutcome` (`handoffTab.ts`) reads once when the tab is
checking, then waits `backoffDelayMs` between reads: 1.5 s, growing by
1.5 times, up to 8 s. `backoffDelayMs` is the unparked branch of
`nextPollDelayMs`, extracted and exported so both pollers share it. The
next read is scheduled only after the previous one answered, so one
request is in flight at a time. Each read times out after 30 s.
`HandoffEndedView` starts the poll and stops it on unmount. The poll
watches `handoffTab`, because the view can mount while the tab still
holds a session that expired a moment ago. The lifecycle in billing-web
does not slow down for a hidden tab, so this poll does not either.
- **The budget is five minutes from `since`**
(`OPERATION_POLL_BUDGET.subscriptionDiscoveryMs`, the longer of the
lifecycle's two budgets for an operation that is not waiting on the
customer). The tab does not know the operation kind after the session
ended. The poll checks the budget after a read, so a tab that wakes from
sleep, or reloads past the budget, reads once before it gives up.
- **One pure function decides.** `afterOutcomeRead(checking, read,
waitedMs)` returns the same state while the tab must read again, or the
final ending. The final ending goes through the same path as a session
end: tab storage, the tab marker, and `handoffTab`.
| Outcome read | Ending | Screen |
| --- | --- | --- |
| `pending`, less than five minutes | stays `payment_pending` | Checking
your payment |
| `succeeded` | `completed` | **You're all set**, with the workspace
name and the operation id as the reference |
| `failed` | `unconfirmed` | **We couldn't confirm your payment**, with
the operation id as the support code |
| `reconciliation_needed` | `unconfirmed` | the same |
| 401 (grace over, or session revoked), 403 (`HANDOFF_DISABLED` and
other refusals), 404 | `unconfirmed` | the same. The poll stops. |
| still `pending`, or only unreadable answers, after five minutes |
`unconfirmed` | the same. The poll stops. |
- **Reload.** A reload while the tab is checking restores
`CheckingPayment` with its bearer and `since`, and the poll continues
inside the same budget. A reload on a final ending shows that ending and
reads nothing.
### Why `failed` does not show "Nothing was charged."
Comfy-Org#23395 sends a payment that the lifecycle reported as `failed` to the
link screen. This PR does not reuse that screen for the outcome read,
because Cloud does not guarantee that a `failed` operation took no
money. Read from Cloud `main` at `7db8aaf7a73`:
- `services/billing/workflows/initial_sub_stripe.go:171` parks a failed
subscription create as `paid_ungrantable` only when a payment is known
to be in flight or the plan grants credits. Every other create error is
recorded as `failed`, and the code says so at `:187-189`: "the
plain-failed branch below also catches ambiguous provider errors, where
Stripe may have committed the create". The same at `:232-240`.
- The create uses `payment_behavior=allow_incomplete`, which "still
attempts the off-session charge"
(`common/gateways/stripe/paid_subscription.go:305-312`).
- A top-up whose invoice could not be finalized and then could not be
voided is recorded as `failed`
(`services/billing/workflows/topup.go:310-316`).
Most `failed` paths void the invoice or cancel the subscription first
and park the operation when they cannot. The paths above are the
exceptions. A read-only pass over the other workflows found more edge
cases of the same kind in older workflow versions. That pass was not
exhaustive.
The same exposure exists for the `failed` report inside a live session
in Comfy-Org#23395 (its Known limit 8). This PR does not change that row.
### Copy check
No copy is added or reworded.
| Screen | Sentence | True for the tab? |
| --- | --- | --- |
| Checking your payment | "If this page still can't confirm it after a
few minutes, contact support with this code:" | Yes, and only now. The
page keeps reading for five minutes. |
| You're all set | "A payment for {workspace} went through." and "Your
reference for this payment:" | Cloud reported that operation as
`succeeded`. The name is the workspace of the ended session. Known
limits 1 and 4 of Comfy-Org#23395 still apply. |
| We couldn't confirm your payment | "Your payment may or may not have
gone through. Don't pay again yet, you could be charged twice." | Yes.
The tab holds no proof either way for `failed`, `reconciliation_needed`,
a refusal, or a payment still pending. |
| We couldn't confirm your payment | "If this page still can't confirm
it after a few minutes, contact support with this code:" | The
instruction is right, and the Contact support link now carries the code.
The sentence suggests that the page still checks, and on this final
screen the page has stopped. See Known limit 3. |
`unconfirmed` shows its code card only when the ending carries a
reference. A session that ends `unconfirmed` without one (Comfy-Org#23395) looks
as before.
## Feature gate
`local_billing_web`. Every line here runs only in a handoff tab, and a
handoff tab exists only after Cloud issues and exchanges a handoff under
that flag.
- `followPaymentOutcome` reads only while `handoffTab` holds
`CheckingPayment`. Only `endingFrom` creates that state, and only from a
live handoff session.
- The outcome route answers 403 `HANDOFF_DISABLED` with the flag off. A
403 ends the tab on `unconfirmed` and stops the poll (unit row "the
billing handoff flag is off").
- A normal signed-in tab never calls the route and keeps no bearer: unit
rows "asks Cloud nothing for a tab that never held a handoff" and "ends
nothing and keeps no bearer in a tab that never held a handoff", and the
e2e "a signed-in tab that is not a handoff never asks for a payment
outcome and keeps no handoff record".
## AS IS / TO BE
Mocked: billing-web production build in headless Chromium, Cloud
answered by Playwright routes, session expiry driven by the browser
clock. AS IS is the same build with `handoffTab.ts`,
`HandoffEndedView.vue`, and `billingWebClient.ts` taken from the merge
commit `999ac96b75`.
| The session ended on an unsettled top-up, then (mocked) | AS IS | TO
BE |
| --- | --- | --- |
| Cloud still reports `pending` | 
| 
|
| Cloud reports `succeeded`, no reload | 
| 
|
| Cloud reports `failed` | 
| 
|
| Cloud refuses the ended session (401) | 
| 
|
The first two rows are the before and after frames of one run: the
heading changes with no reload. The four AS IS files are byte-identical,
which is the defect.
## Security notes
- **Where the bearer lives.** In tab storage (`sessionStorage`, the key
that already holds it during the live session) and in the tab's state,
inside the `payment_pending` record only. It is never in a URL, in
`window.name`, or in a log. A handoff tab loads no third-party telemetry
(`e2e/handoff-telemetry.spec.ts`).
- **Where it goes.** To `GET {Cloud}/api/billing/ops/{id}/outcome` in
the `Authorization` header, with `credentials: 'omit'`. The reader
builds that route itself. Unit test: "sends the kept bearer to the
outcome route alone, without cookies".
- **What it can do.** After the session expires, Cloud accepts it on the
outcome route only, and that route returns `{ status }` for an operation
of the session's workspace and nothing else. If the tab ended the
session early because its clock runs ahead of Cloud's, the bearer stays
a full scoped session until Cloud's own expiry, as it was while the
session was live.
- **When it is dropped.** On the first final answer, on a refusal, and
when the five-minute budget ends. The final ending replaces the stored
record. If that write fails, the tab removes the record. Unit rows
assert that storage does not contain the bearer after each final ending.
- **How long it can stay in storage.** While the page is open, at most
the budget plus one read. Cloud stops honouring an expired session 30
minutes after its expiry. The client does not copy that number. It stops
on Cloud's 401. A tab that stays closed-lid or discarded still holds the
bearer until it is next opened (one read, then the budget or a 401 drops
it) or closed (`sessionStorage` ends with the tab).
## Known limits
1. **Before Cloud serves the route.** Against a Cloud without the
outcome route the read gets no outcome. If Cloud answers 404, the tab
moves from Checking your payment to We couldn't confirm your payment at
once. With any other answer it moves there after five minutes. Which
answer such a Cloud gives was not checked. Comfy-Org#23404 names the release this
PR waits for.
2. **A payment that settles after the budget.** A customer who finishes
on Stripe more than five minutes after the session ended sees We
couldn't confirm your payment, and that ending is final. Only a tab that
was not open during those minutes reads once more when it is opened.
3. **The code-card label on the final `unconfirmed` screen** says "If
this page still can't confirm it after a few minutes", and the page has
stopped checking by then. Design has to decide whether that screen needs
its own label. This PR adds no copy.
4. **`failed` after a plain decline.** A card decline also ends on We
couldn't confirm your payment, because the outcome route reports a
status and no reason. The live session shows the decline itself while it
lasts.
5. **A tab that ended on an older build** stored no bearer. It keeps the
static Checking your payment screen.
6. **No telemetry.** A handoff tab reports nothing, so refusals and
exhausted budgets are not counted anywhere.
7. **The types do not forbid a bearer on another ending.** An object
spread could carry `token` onto a final record and still compile. No
code does that, and the tests assert the stored record after every final
ending.
8. Known limits 1 and 4 of Comfy-Org#23395 carry over to the `succeeded` row: a
scheduled plan change can succeed without a charge, and an operation
adopted from Cloud's status reads as a payment.
## Verification
- **Red first.** Against a stub reader and a poll that does nothing, 8
of the 16 reader tests, 18 of the 23 poll tests, and 3 view tests fail
on their assertions: the heading does not change, no request leaves the
tab, and the stored record keeps its shape. For `13e2b67de0`, 4 of the
26 poll tests fail first: the budget restarts after a reload, the poll
does not start when a session ends under the mounted view, and the
stored record has no `since`.
- **Unit, green.** billing-web: the handoff files,
`billingWebClient.test.ts`, and `HandoffEndedView.test.ts`, 179 tests.
account-core: `operationOutcome`, 16 tests. `operationPolicy` and
`operationLifecycle` passed at `8630e81c56` (88 tests) and are unchanged
since. The pre-commit hook ran `typecheck:app`,
`typecheck:account-core`, and `typecheck:billing-web`.
- **What the poll tests pin** (`handoff/paymentOutcome.test.ts`, real
reader, mocked `fetch`, fake timers): one row per outcome in the table
above, each with the stored record, the tab marker, and no further read.
The cadence. One read in flight. The five-minute budget for a pending
payment and for unreadable answers, also across a reload. Stop, also
with an answer on its way. A session that ends under the mounted view.
The bearer sent to the outcome route alone. The stored bearer removed
when the ending cannot be written. Five states that must read nothing.
- **Reload** (`handoffBootstrap.test.ts`): a stored checking record
restores with its bearer, the poll then reaches a final ending, and the
next reload keeps that ending without a read.
- **Mutation checks.** A script applied 31 defects one at a time and ran
the affected files. Each turned tests red. Among them: the bearer kept
on a final ending, the poll continued after a refusal, `failed` mapped
to the link screen or to `completed`, `reconciliation_needed` mapped to
`completed` or left pending, no budget, a budget that restarts on
reload, two reads in flight, no stop on unmount, the bearer dropped on
reload, cookies sent, 401 or 404 read as "no answer".
- **E2E** (`e2e/handoff-end-screens.spec.ts`, production build, mocked
Cloud), 5 new tests: pending then `succeeded` changes the heading with
no reload and leaves no bearer in storage, a reload while checking
continues the check, `failed` ends `unconfirmed`, a 401 ends
`unconfirmed` after one read, and a signed-in tab never calls the route.
The four handoff specs pass together, 16 tests. Against the AS IS build
the first four fail and the signed-in guard passes.
- **`fallow` gate.** The audit against the base reports no finding for
this branch (run locally at `13e2b67de0`).
- **Merge fallout.** The two parent branches merge without a text
conflict. One fixture that Comfy-Org#23395 added (`CAN_TOP_UP` in
`billingWebClient.test.ts`) lacked `can_set_budgets` and
`can_set_hard_caps`, which Comfy-Org#23404 makes required. Without them 15 of the
55 tests in that file fail. Whichever of the two PRs merges second needs
the same two lines.
- **Not run.** A live Cloud session and the rest of the billing-web
suites. The Cloud facts are read from code. The captures were checked by
text recognition and file hash, not by eye.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The bot sync #23331 is red. Its regenerated types make three response fields required, and the fixtures that build those responses no longer typecheck. We need the sync for
GET /api/billing/ops/{id}/outcome(BillingOpOutcomeResponse, Comfy-Org/cloud#19213), which the billing-web follow-up for FRONT-3855 reads.This PR takes the bot's generated files unchanged (
update-ingest-typesat d4a238c, cloud@9d3282f6) on top ofmainand fixes the fallout.Supersedes #23331
Dependency graph
What the sync brings
GET /api/billing/ops/{id}/outcomewithBillingOpOutcomeResponse(statusispending,succeeded,failedorreconciliation_needed) andzGetBillingOpOutcomeResponse.GET /api/v1/catalog/docs(GetCatalogDocs*). Nothing in the repo imports it.BillingCapabilities.can_set_budgetsandcan_set_hard_caps(cloud#19173),auto_top_up_conflictonAutoReloadSettings,BudgetListandBudgetWriteResult(cloud#19175), andCccPageRow.on_desktop. Nothing in the repo builds or readsBudgetList,BudgetWriteResultorCccPageRow.denied_reasonsgains the keyscan_set_budgetsandcan_set_hard_caps, and with them one new reason,plan_not_enterprise.GetCatalogAgentInstructionsErrorandGetCatalogOpenApiError(400, 401 and 403 added).BillingOpStatusResponseandSubscribeRequest.Fallout fixed
BillingCapabilitiesliterals in 20 fixture, mock and test files undersrc/platform/{auth,billing},packages/account-core,packages/account-ui,apps/billing-webandbrowser_testscan_set_budgets,can_set_hard_capsfalsefor both. Ingest servesfalsewhen billing-api omits the field, and no code reads either one.AutoReloadSettingsliterals undersrc/platform/billing,packages/account-core,packages/account-uiandbrowser_testsauto_top_up_conflictfalse, which the spec reads as "show no warning". The schema isz.boolean(), not nullable.billingCapabilities.contract.test.tsSome of these fixtures are untyped wire bodies that the Zod readers parse, so they fail at run time and not at typecheck. With
main's fixtures, 79 tests fail in four account-core files (capabilities,topup,scopedReader,autoTopUp), and the billing-web browser specs fail because the order summary never renders. #23331 did not show this: its unit job was skipped behind the typecheck failure, and itsbilling-web-e2ejob was cancelled at the 20-minute limit.Production code has two changes:
packages/account-core/src/core/billing/capabilityDenials.ts:CapabilityDenialReasonandKNOWN_REASONSgainplan_not_enterprise. The contract test requires the client union to equal the server union.apps/billing-web/src/checkout/endingScreen.ts:REFUSAL_COPYmapsplan_not_enterprisetounknown, the generic copy. The record is exhaustive over the union, so it needs the key.No user-visible change
No code reads the new fields or calls the new route. Cloud sends
plan_not_enterpriseonly underdenied_reasons.can_set_hard_caps, which nothing reads. Before this PR the reason decoded asunspecified, which billing web also shows with the generic copy. There is nothing to screenshot.One condition applies. The generated Zod makes the three fields required, and the SDK readers parse with it (
capabilities: zBillingCapabilitiesincapabilities.ts,zGetBillingAutoReloadResponseinautoTopUp.ts). An ingest that does not send the fields fails those reads, and billing-web checkout does not render. Cloud main includes cloud#19173 and cloud#19175, both merged on 2026-11-13. The latest Cloud release tag, v0.546.15, predates both. Deploy ingest with those two changes before a frontend that contains this sync reaches users. #22913 carried the same condition for its two capability fields.Feature gate
Types and test data only. No behavior changes behind or outside any flag.
Verification
lint:server-facts,typecheck:app,typecheck:browser,typecheck:billing-web,typecheck:account-coreandtypecheck:account-uipass. The pre-push hook (deps:audit,knip,check:generated) passes.src/core/billing1373/1373, account-uisrc/billing406/406, billing-web 1655/1655, appsrc/platform/billingwith the web-session and billing-tab tests 4713/4713.checkout.spec.tsandfull-page-topup.spec.ts31/31. Without the two capability fields in the e2e fixture,full-page-topup.spec.tsfails.git diff origin/update-ingest-types HEAD -- packages/ingest-typesis empty.