Repository navigation
fix(agent-runtime): do not treat billing or disk quota as rate limit - #1876
Conversation
A bare /quota/ match classified spending, credit, billing, and disk exhaustion as PROVIDER_RATE_LIMITED. The runtime then backed off and retried failures that cannot recover. Keep insufficient_quota and real throttle wording retryable, and mark those account and filesystem quotas terminal.
vastsa
left a comment
There was a problem hiding this comment.
The reported problem is real, but this exception leaves the same retry loop in a common billing case. The !insufficient_quota guard skips EXHAUSTED_QUOTA_PATTERN whenever that token appears, and the new test explicitly expects insufficient_quota: Billing quota exceeded to remain retryable. OpenAI's current error-code guide says billing errors can still use the broader insufficient_quota type and that retrying billing, spend, or quota errors does not restore access: https://developers.openai.com/api/docs/guides/error-codes. Please classify explicit billing/spend/credit exhaustion as terminal even when the provider includes insufficient_quota, and add a regression using the full billing error shape. Keep recognized throughput throttles retryable. Thanks for the focused change and clear repro; this edge needs to be corrected before the fix closes the reported retry loop.
|
Re-reviewed the current head against current main (the billing exception is still present). This is a code-level root-cause blocker, independent of CI: |
Provider billing and account exhaustion can arrive as HTTP 429 and use the insufficient_quota type. Classify explicit exhaustion before the generic 429 retry path while preserving retries for throughput limits. Add classifier and retry-flow regressions and sync the runtime specs.
vastsa
left a comment
There was a problem hiding this comment.
Verified against the latest main. The retry defect is real; explicit billing/account exhaustion now remains terminal before generic 429 handling, while throughput limits remain retryable. The regression covers the full billing 429 shape and confirms the request is attempted only once. Package tests and typecheck pass.
|
Thanks for the focused fix. I verified the billing retry defect and merged the PR with a small completion: explicit |
Fixes #1875
What
quotaout of the throughput rate-limit matcher.PROVIDER_ERRORbefore generic HTTP 429 handling. This includesinsufficient_quota,credit_balance_exhausted, organization/project spend-limit codes, organization usage limits, and billing/spending/credit/disk quota messages.rate limit,too many requests, throttling, and genericquota exceededwording retryable.Why
Account and filesystem exhaustion do not recover by backing off. The previous exception let common
insufficient_quotabilling responses enter the same retry loop, including when returned with HTTP 429.How tested
packages/agent-runtime:vitest run→ 1520/1520 passed.tsc -p packages/agent-runtime/tsconfig.json --noEmitpassed.Scope
Runtime error classification, its retry-flow tests, and the synchronized runtime error/E2E specifications.