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
Demote the AI budget circuit breakers to observe-only at this stage. Keep the structural caps and the usage meter; stop hard-blocking on dollar/token ceilings. Re-enable enforcement at paid launch.
The catastrophic failure mode is already covered structurally. Unbounded looping/recursion — the actual "print money" risk — is bounded by the structural caps (tool loop max 3 rounds; Loop MAX_ITERATIONS_CAP=50; delegation depth-4 / 50-fanout; apply single-flight). Those are deterministic, need no calibration, and don't false-positive. They stay.
The values were never calibrated ($50, 250M, $5/tree, ×25, 50 delegations are round-number guesses; the acceptance criterion at delegation-budget.ts:37 — "target ~0 interrupted runs" — was never filled in). Rather than calibrate a control we don't need yet, turn it off.
What changed (this issue)
New soft-launch switch BUDGET_ENFORCE (default off), mirroring isPaywallEnforced (billing.ts:185). The two daily account circuit breakers (chargedMicros and tokens) in reserveDelegation (delegation-budget-store.ts) only block when it is on; otherwise usage is metered but never stopped.
Kept, untouched: the structural per-tree caps (delegations / depth in the atomic UPDATE) and the whole ai_usage meter + /v1/usage.
Visible reminders that it's off (so we get nudged to turn it on):
Loud comment at the gate referencing this issue.
Commented-out BUDGET_ENFORCE in workers/api/wrangler.toml next to PAYWALL_ENFORCE.
A note on the console Usage page: "Budget limits are disabled (observe-only) — usage is metered but never blocked."
Enforcement tests set BUDGET_ENFORCE:"1" so the breaker logic stays covered.
Re-enable trigger
Turn BUDGET_ENFORCE on when the subscription-pool economics go live (creators paid from platform Workers-AI/quota spend) — that is when unattributed token use becomes our cost and a real, calibrated breaker earns its place. By then the ai_usage distribution exists to calibrate it from. Until then: meter + structural caps + (later) an alert on payer='platform' spend, which is the only path that is real platform money.
Parked under this decision (deferred, not before external users)
Decision
Demote the AI budget circuit breakers to observe-only at this stage. Keep the structural caps and the usage meter; stop hard-blocking on dollar/token ceilings. Re-enable enforcement at paid launch.
Why
cost_microsis list-price arithmetic (ai-pricing.ts), not what the provider actually charged (caching/discounts/batch move it). A hard stop on an estimate of someone else's bill guards the wrong thing with a number we can't trust. (Root of the [bug] The $50 circuit breaker is denominated in dollars for work nobody is billed for — subscription engine usage blocks delegations #343/[coordination] Autonomous work budget — bound spend across every unattended entry point #184 denomination pain.)MAX_ITERATIONS_CAP=50; delegation depth-4 / 50-fanout; apply single-flight). Those are deterministic, need no calibration, and don't false-positive. They stay.delegation-budget.ts:37— "target ~0 interrupted runs" — was never filled in). Rather than calibrate a control we don't need yet, turn it off.What changed (this issue)
BUDGET_ENFORCE(default off), mirroringisPaywallEnforced(billing.ts:185). The two daily account circuit breakers (chargedMicrosandtokens) inreserveDelegation(delegation-budget-store.ts) only block when it is on; otherwise usage is metered but never stopped.ai_usagemeter +/v1/usage.BUDGET_ENFORCEinworkers/api/wrangler.tomlnext toPAYWALL_ENFORCE.BUDGET_ENFORCE:"1"so the breaker logic stays covered.Re-enable trigger
Turn
BUDGET_ENFORCEon when the subscription-pool economics go live (creators paid from platform Workers-AI/quota spend) — that is when unattributed token use becomes our cost and a real, calibrated breaker earns its place. By then theai_usagedistribution exists to calibrate it from. Until then: meter + structural caps + (later) an alert onpayer='platform'spend, which is the only path that is real platform money.Parked under this decision (deferred, not before external users)
ai_usagep99) — only needed once enforcement returns.Reframes epic #478; the D1 config resolver from #474 stays in place (we'll want it when enforcement returns).
Acceptance criteria
BUDGET_ENFORCEenv switch exists, default off; account circuit breakers are no-ops when off.ai_usagemeter are unchanged.wrangler.tomlcarries the commented-out flag; gate comment references this issue.BUDGET_ENFORCE:"1"; a new test asserts no block when off.