fix(codex): bounded single pool retry on account-specific unsupported-model 400 (#335)#352
Conversation
|
Warning Review limit reached
Next review available in: 1 minute Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Dual review (security + bugs/edge cases)No unresolved bot review threads (CodeRabbit rate-limited; 0 inline comments). CI is green. This touches pool account-selection (MAINTAINERS.md security boundary) — independent security + edge-case pass below. Security categories checkedNo malware, backdoor, hidden C2, local admission bypass, classic XSS, or new credential/body logging. Retry authorization is server-side only: the allow-list matches a cloned, bounded upstream 400 body against an exact model-bound sentence (whitespace/case normalized), never against client-supplied text. Regex injection is structurally avoided (string equality after normalize). BlockersNone for merge from a security-boundary perspective, assuming the sticky-affinity tradeoff below is accepted or fixed. Should-fix before merge
Non-blocking / already solid
Suggested fix order
Maintainer security sign-off still recommended given the pool-selection adjacency, but this review did not find an auth bypass or health-policy regression. |
beab5b3); goalplan roadmap lock
Summary
Fixes #335: in Pool mode, an account-specific unsupported-model 400 from the ChatGPT backend was returned directly to the client even when another pooled account could serve the model. The proxy now performs exactly ONE bounded retry with a different eligible pooled account.
Design (intentional refinement of the 35d28a0 policy)
The
4xx = caller fault, no failoverclassification from 35d28a0 is deliberately preserved: this change adds a narrow, allow-listed exception that never touches account health.The '<requested routed model id>' model is not supported when using Codex with a ChatGPT account.— the interpolated model id must match the routed request. No substring/keyword/regex matching; regex injection is structurally impossible.caller and model 4xx responses do not penalize account healthstays green and unmodified (src/codex/routing.tsuntouched).Tests
Activations A–E plus a 10-test negative matrix (8 hostile-body classes + 2 retry-failure paths) as named tests in
tests/server-auth.test.ts/tests/codex-auth-context.test.ts(+483 lines):Security review
This touches pool account-selection logic (MAINTAINERS.md security boundary). Self-audit: exact model-bound equality, bounded clone inspection, single alternate dispatch, unchanged caller-health policy, no new body/token/account logging. Explicit maintainer security review requested before merge.
Design/audit trail:
devlog/_plan/260724_bugfix_train/020_pool_retry_400.md(security-focused adversarial audit, 2 rounds).Closes #335.