Skip to content

Fix retry classification for throttling and quota errors - #45602

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/7985eba71ba4a6fe897a45957e448fadd42f3963
Sep 15, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/7985eba71ba4a6fe897a45957e448fadd42f3963

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Fix retry classification for throttling and quota errors

Why

slow_down errors were treated as terminal server overloads, while exhausted credit balances and spend limits fell through to retryable stream errors.

What changed

  • Classify slow_down as a retryable rate limit in HTTP 503 responses and SSE failures, preserving the server message and parsing retry delays from SSE error messages.
  • Map credit_balance_exhausted, organization_spend_limit_exceeded, and project_spend_limit_exceeded SSE errors to quota exhaustion so they terminate without retries.

Testing

Extend tests to cover HTTP error classification and retryability, slow_down stream retry exhaustion and message-provided delays, and a single UsageLimitExceeded error with no retries for each quota error code.

## Why

`slow_down` errors were treated as terminal server overloads, while exhausted credit balances and spend limits fell through to retryable stream errors.

## What changed

- Classify `slow_down` as a retryable rate limit in HTTP 503 responses and SSE failures, preserving the server message and parsing retry delays from SSE error messages.
- Map `credit_balance_exhausted`, `organization_spend_limit_exceeded`, and `project_spend_limit_exceeded` SSE errors to quota exhaustion so they terminate without retries.

## Testing

Extend tests to cover HTTP error classification and retryability, `slow_down` stream retry exhaustion and message-provided delays, and a single `UsageLimitExceeded` error with no retries for each quota error code.

GitOrigin-RevId: 7985eba71ba4a6fe897a45957e448fadd42f3963
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/7985eba71ba4a6fe897a45957e448fadd42f3963 branch from ad312c0 to 31ffe2b Compare September 15, 2026 04:20
@copyberry
copyberry Bot merged commit 31ffe2b into main Sep 15, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/7985eba71ba4a6fe897a45957e448fadd42f3963 branch September 15, 2026 04:20
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 15, 2026

This branch was previously deployed

1 inactive deployment
issue-triage — 31ffe2bc Deployed Sep 15, 2026 by Azukali via Generate label suggestions #45621
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants