Skip to content

Codex throttling no longer shows a false usage limit - #48218

Merged
brennanb2025 merged 2 commits into
mainfrom
brennanb2025/codex-limit-unknown
Nov 24, 2026
Merged

brennanb2025 merged 2 commits into
mainfrom
brennanb2025/codex-limit-unknown

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

When Codex was briefly too busy to answer, Orca told you that you'd hit your usage limit and showed "Reset time unknown", even though you still had usage left. Now that case says Codex's service is busy, so you know to wait a little and send again.

What Changed

  • Before: a Codex turn that gave up after repeated "429 Too Many Requests" retries, or that hit a "slow down" throttle, showed "Codex usage limit reached / Reset time unknown". No limit had been reached, so there was never a reset time to show.
  • After: those turns show the existing "Codex couldn't respond because the service is busy" notice, with Codex's own error text under Details. A real usage limit still shows the usage-limit card with its reset time, as before.
  • Mechanism: only Codex's own quota error counts as a usage limit. Throttles and a retry-exhausted 429 map to the existing provider-unavailable notice. Sign-in (401) handling still runs first.

Why

Codex reports a real quota with its own error kind, and that error carries the reset time. A plain 429 is a temporary throttle that Codex retries and then gives up on. Calling it a usage limit gave a false "limit reached" with no reset time, and offered waits and Continue controls that could never apply. Showing the real error is more honest than hiding the missing time.

Linked Issue

N/A (internal report)

Visual Proof

Dev builds, real Codex CLI, local mock upstream. Before, a 429 throttle: before-throttle.png
After, the same throttle: after-throttle.png
After, a "slow down" throttle and then a real usage limit (the card still shows its reset time): after-quota.png

Testing

  • I manually tested these changes locally: Linux dev build with the real Codex CLI against a mock upstream (plain 429, 503 slow down, real usage limit with a reset time), on both the base and the fixed build.
  • Automated tests added/updated: one test drives the real failure classifier for all three errors.
  • Every added test fails without this change and avoids the test anti-patterns

Performance

None, because this only changes how one error is classified when a turn fails.

Risk

Level: Low. If Codex ever reported a real quota without its quota error kind, the chat would show "service is busy" instead of the limit card. Codex always sends its quota error for real limits. Saved history keeps its old rows. Back out with a plain revert.

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Security, mobile and SSH: no change beyond the new classification, which the host makes and phones display as-is. Remote hosts pick it up when they update. Cross-platform: no platform-specific code.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots attached
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@brennanb2025
brennanb2025 marked this pull request as ready for review November 24, 2026 10:31
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Codex usage-limit detection now accepts only usageLimitExceeded. Near-spent-window inference no longer depends on a rejection flag. Journal failure classification maps rateLimitExceeded to providerUnavailable, and maps responseTooManyFailedAttempts to providerUnavailable for HTTP 429 and providerResponseFailed otherwise. A journal test checks the classifications for HTTP 429, rateLimitExceeded, and usageLimitExceeded.

Merge Risk: Minimal · up to 42c8c

Codex throttling and "slow down" errors now show the service-busy notice instead of a false usage-limit card. Real usage limits still show the reset time. The change is small and tested, and no actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Codex throttling errors no longer get reported as a usage limit. The raw summary and objectives confirm that 429 and rateLimitExceeded errors now map to providerUnavai…
Description check Passed The description follows the template closely. It has ELI5, What Changed (before and after with mechanism), Why, Linked Issue (marked N/A with an internal-report reason), Visual Proof with before and a…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: Codex throttling errors no longer get reported as a usage limit. The raw summary and objectives confirm that 429 and rateLimitExceeded errors now map to providerUnavailable, and only usageLimitExceeded maps to the usage-limit card. The title is specific and does not use vague terms.

Full details: Description check

Explanation

The description follows the template closely. It has ELI5, What Changed (before and after with mechanism), Why, Linked Issue (marked N/A with an internal-report reason), Visual Proof with before and after images, Testing with checked items, Performance with a completed 'None, because' line, Risk with a Low level and a back-out plan, AI Disclosure left out, the upstream boundary checkbox, Notes, and Checklist. Linked Issue is weak: the template says there should always be a link for outside contributors. The author's reason is 'N/A (internal report)', and the 'Fixes #' line was replaced. The AI Disclosure section is missing content but the template says to skip it for team members. The Review section has no content. These gaps are minor.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 49f79c7e-6817-49fc-b6e4-48ccb38e5d1c
Commits

Reviewing files that changed from the base of the PR and between 915fa47 and 42c8c59.

Files selected for processing: 3

  • src/main/codex/structured/catalog/codex-usage-limits.ts
  • src/main/codex/structured/journal/codex-structured-journal-items.test.ts
  • src/main/codex/structured/journal/codex-turn-failures.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status

Problem: when Codex gave up after repeated "429 Too Many Requests" retries, or hit a "slow down" throttle, the chat said "Codex usage limit reached / Reset time unknown" even though the account still had usage left.

User-facing change: those turns now show "Codex couldn't respond because the service is busy. Pick another model, or wait a little and send again.", with Codex's error text under Details. Real usage limits still show the usage-limit card with its reset time.

Fixed during review

  • Added a test that runs the real failure classifier on all three errors. It fails if either half of the fix is reverted.
  • Completed the PR description and added before/after screenshots.

Deferred (not blocking)

  • The test doesn't separately check that a non-429 retry give-up (for example 500) keeps the generic "couldn't finish" notice. The code does keep it.
  • A Codex "usage not included in your plan" error still shows the usage-limit card with no reset time. That has a different cause, so it's a separate change.

Verified

  • Linux dev build with the real Codex CLI against a mock upstream, on both the base and the fixed build.
    • Base: a plain 429 showed "usage limit reached / Reset time unknown".
    • Fixed: a plain 429 and a 503 "slow down" both showed the busy notice.
    • Fixed: a real usage limit showed the card with the correct reset time.
  • Changed-file checks: 27 of 27 passed. CI is green.
  • Two independent reviews found no code defects. The final regression audit on the change merged onto current main is SAFE.
  • Perf: the change only runs when a turn fails, and it adds no repeated or growing work.

Screenshots are in the PR description.

@brennanb2025
brennanb2025 merged commit 1f4588e into main Nov 24, 2026
84 of 85 checks passed
Jinwoo-H pushed a commit that referenced this pull request Nov 24, 2026
* Fix false Codex usage limit warnings during throttling

* Cover Codex throttle messages in the journal
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