Repository navigation
fix(resilience): retry Codex pre-output transport failures on the same account (#9708) - #10792
Conversation
|
Reviewed and validated in an isolated worktree off Tests: Circuit-breaker/cooldown interaction: traced this carefully since it touches the resilience layers described in AGENTS.md — no conflict. The same-account retry only exempts the first pre-output 502/503/504/507 blip; a second consecutive failure on the same connection falls through unchanged into the existing Two things worth a quick look before/after merge, neither blocking:
Also noticed 3 unchecked boxes in the test plan (live-account 503/507 retry, second-failure rotation, mixed-pool 503) — the automated coverage looks solid to me as a substitute, but flagging in case you want to close the loop with a live check per the repo's bug-fix protocol. Overall: solid, well-scoped fix mechanically. ⭐⭐⭐⭐ |
…fallback and combo hops #10792 (#9708) added a same-account retry for retryable 502/503/504/507 transport failures, applied uniformly inside handleSingleModelChat. Two other paths call into the same function recursively/iteratively and each carries its own documented single-call guarantee that the retry silently broke: - Emergency fallback (#1731): exactly one hop to the free fallback model, no extra calls against an already-exhausted provider. The retry was doubling that call whenever the fallback model itself returned a transient-looking status. - Combo routing: target-level fallback is the combo's own policy (next target, not same-account retry). The retry delayed that policy and could surface the wrong terminal status when a later combo/global-fallback hop threw. Both regressions were already covered by existing tests in chat-route-coverage.test.ts (asserting exact call counts / preserved status) — confirmed red on the release tip before this fix, green after. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
…e account (diegosouzapw#9708) (diegosouzapw#10792) Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution! (cherry picked from commit aa32d2e)
…e account (diegosouzapw#9708) (diegosouzapw#10792) Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
…fallback and combo hops diegosouzapw#10792 (diegosouzapw#9708) added a same-account retry for retryable 502/503/504/507 transport failures, applied uniformly inside handleSingleModelChat. Two other paths call into the same function recursively/iteratively and each carries its own documented single-call guarantee that the retry silently broke: - Emergency fallback (diegosouzapw#1731): exactly one hop to the free fallback model, no extra calls against an already-exhausted provider. The retry was doubling that call whenever the fallback model itself returned a transient-looking status. - Combo routing: target-level fallback is the combo's own policy (next target, not same-account retry). The retry delayed that policy and could surface the wrong terminal status when a later combo/global-fallback hop threw. Both regressions were already covered by existing tests in chat-route-coverage.test.ts (asserting exact call counts / preserved status) — confirmed red on the release tip before this fix, green after. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Summary
429 All codex accounts reached configured quota threshold.Closes #9708
Test plan
node --import tsx/esm --test tests/unit/codex-same-account-transport-retry-9708.test.tsnode --import tsx/esm --test tests/unit/sse-auth.test.ts --test-name-pattern quota