Repository navigation
Distinguish HTTP quota errors from rate limits - #44492
Merged
copyberry[bot] merged 1 commit intoSep 10, 2026
Merged
copyberry[bot] merged 1 commit into
copyberry[bot] merged 1 commit into
Conversation
## Why HTTP 429 responses for exhausted quota, credit balances, and spending or usage limits were reported as retry-limit failures instead of usage-limit errors. ## What changed Parse the API error's `code` and map `insufficient_quota`, `credit_balance_exhausted`, `organization_spend_limit_exceeded`, `project_spend_limit_exceeded`, and `organization_usage_limit_exceeded` to `CodexErr::QuotaExceeded`. Also recognize `insufficient_quota` in the error's `type` field. ## Testing Add a regression test covering all recognized quota errors and verifying that `rate_limit_exceeded` and `slow_down` HTTP 429 errors retain their existing retry-limit mapping. GitOrigin-RevId: b075dba199e08d29563630f5ada846e3e7fd11ff
copyberry
Bot
force-pushed
the
copyberry/codex-internal-to-codex-oss/b075dba199e08d29563630f5ada846e3e7fd11ff
branch
from
September 10, 2026 10:31
3d78436 to
102fc57
Compare
copyberry
Bot
deleted the
copyberry/codex-internal-to-codex-oss/b075dba199e08d29563630f5ada846e3e7fd11ff
branch
September 10, 2026 10:31
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Distinguish HTTP quota errors from rate limits
Why
HTTP 429 responses for exhausted quota, credit balances, and spending or usage limits were reported as retry-limit failures instead of usage-limit errors.
What changed
Parse the API error's
codeand mapinsufficient_quota,credit_balance_exhausted,organization_spend_limit_exceeded,project_spend_limit_exceeded, andorganization_usage_limit_exceededtoCodexErr::QuotaExceeded. Also recognizeinsufficient_quotain the error'stypefield.Testing
Add a regression test covering all recognized quota errors and verifying that
rate_limit_exceededandslow_downHTTP 429 errors retain their existing retry-limit mapping.