Skip to content

fix(codex): same-request multi-account failover on quota 429 (#584) - #585

Merged
Wibias merged 3 commits into
lidge-jun:devfrom
Wibias:feat/584-codex-multiaccount-failover
Jul 28, 2026
Merged

fix(codex): same-request multi-account failover on quota 429 (#584)#585
Wibias merged 3 commits into
lidge-jun:devfrom
Wibias:feat/584-codex-multiaccount-failover

Conversation

@Wibias

@Wibias Wibias commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix Multi-account failover issue: Session freezes on depleted primary account despite active secondary Pro account #584: when the active Codex pool account returns a pre-stream 429/402, retry once on an eligible alternate account in the same request (mirrors the existing allow-listed model-400 pool retry and API-key 429 rotation).
  • Sticky threads whose bound account is already over �utoSwitchThreshold rebind immediately instead of waiting up to 60s.
  • Docs note + regression tests for HTTP and streamed pre-stream 429 failover, single-account fail-closed, and immediate affinity rebind.

Why

Routing already cooled the depleted account and switched �ctiveCodexAccountId after a 429, but the failing turn was still returned to Codex CLI — which shows the limit/overuse UI and stalls until the user manually retries. Same-request failover makes the secondary Pro account transparent.

Test plan

Retry exhausted primary accounts once on an eligible alternate within the same turn, and rebind over-threshold sticky threads immediately so Codex CLI does not stall when a secondary still has quota (lidge-jun#584).
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Wibias, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 21 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 49900942-43df-4663-b577-8eb9ad81ce18

📥 Commits

Reviewing files that changed from the base of the PR and between 94a83bc and e589087.

📒 Files selected for processing (5)
  • docs-site/src/content/docs/reference/configuration.md
  • src/codex/routing.ts
  • src/server/responses/core.ts
  • tests/codex-routing.test.ts
  • tests/server-auth.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the bug Something isn't working label Jul 28, 2026
@Wibias

This comment was marked as outdated.

@Wibias

This comment was marked as outdated.

@coderabbitai

This comment was marked as outdated.

@chatgpt-codex-connector

This comment was marked as outdated.

Also classify HTTP 402 as quota so same-request failover cools the depleted account consistently with 429.
@Wibias

This comment was marked as outdated.

@Wibias

This comment was marked as outdated.

@coderabbitai

This comment was marked as outdated.

@chatgpt-codex-connector

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

After a successful same-request pool failover, update subagentFallbackAccountId so streamed terminal 429s attribute health to the account that actually served.
@Wibias
Wibias merged commit 903b62c into lidge-jun:dev Jul 28, 2026
9 checks passed
@Wibias
Wibias deleted the feat/584-codex-multiaccount-failover branch July 30, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant