Skip to content

Provision Autumn customers for orgs and self-heal customer_not_found - #1780

Merged
RhysSullivan merged 2 commits into
mainfrom
fix/autumn-customer-provisioning
Aug 27, 2026
Merged

Provision Autumn customers for orgs and self-heal customer_not_found#1780
RhysSullivan merged 2 commits into
mainfrom
fix/autumn-customer-provisioning

Conversation

@RhysSullivan

@RhysSullivan RhysSullivan commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Problem

An organization created in the product was never registered as a customer with the billing provider, and both billing paths use non-creating endpoints (balance check, usage track). So for an affected org every billing call answered 404 customer_not_found, permanently: the balance gate failed open (correct for an outage, catastrophic as a steady state) and usage tracking is fire-and-forget, so the org ran unlimited executions and none of them ever reached the meter. Unbilled, and invisible from the product side.

Nothing provisioned the customer on the way in: all three customers.getOrCreate call sites are conditional (over-free-org-limit check, member seats, the rate limiter's paid exemption), so an org that trips none of them stays unknown to billing forever.

Fix

  • createOrganization provisions the org's billing customer up front. Non-fatal: a billing blip must not block signup.
  • At the billing seam, a 404 customer_not_found is classified as its own AutumnCustomerNotFoundError. The balance check and the usage track create the customer and retry once, so the usage lands instead of being lost. A genuine provider outage still surfaces as AutumnError, unretried, and still pages.
  • Span-name fix: an inline arrow's name is "", not nullish, so ?? left every billing call tracing as the bare span autumn..

Testing

New cloud e2e e2e/cloud/billing-customer-provisioning.test.ts, black-box against the billing emulator's own state:

  1. a new organization exists as a customer at the provider;
  2. with a one-shot 404 customer_not_found armed on both billing endpoints, the execution still runs and still lands on the meter;
  3. an unrelated 404 is left alone — one attempt, no retry, no repair — so a real provider failure is still reported;
  4. a customer_not_found the repair cannot close is attempted exactly twice (once, once after provisioning) and then given up on — the retry is bounded, not a loop in a forked, untimed fibre.

Scenarios 1, 2 and 4 reproduce or bound the production symptom: on unmodified product code they fail (customer list empty; 0/1 usage events; no repair attempt at all) and pass with the fix. Scenario 3 is a guard and passes either way. Ledger assertions are attributed to the scenario's own organization, so another scenario's faulted call can't stand in for them. Existing metering and execution-limit e2e still green; typecheck, lint, format:check clean.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 27, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 6813d37 Commit Preview URL

Branch Preview URL
Aug 27 2026, 10:24 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 27, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud 6813d37 Aug 27 2026, 10:26 PM

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@pkg-pr-new

pkg-pr-new Bot commented Aug 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@1780

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@1780

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@1780

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@1780

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@1780

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@1780

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@1780

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@1780

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@1780

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@1780

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@1780

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@1780

executor

npm i https://pkg.pr.new/executor@1780

commit: 6813d37

@RhysSullivan
RhysSullivan force-pushed the fix/autumn-customer-provisioning branch from 8fd092c to 8f3317b Compare August 27, 2026 20:26
@RhysSullivan
RhysSullivan marked this pull request as ready for review August 27, 2026 23:09
@RhysSullivan
RhysSullivan merged commit 61b3d9a into main Aug 27, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant