fix: harden codex stale timeout and minimax overload retries - #11462
fix: harden codex stale timeout and minimax overload retries#11462Obrais-cloud wants to merge 1 commit into
Conversation
614fdf8 to
045644b
Compare
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused retry and timeout work. The Codex half has since landed through a broader refactor, but the generic overload retry gap remains.
Problems
- Current main already estimates Responses payloads from
input,instructions, andtoolsinagent/chat_completion_helpers.py:66-112; it also applies the OpenAI-Codex large-payload stale floor atagent/chat_completion_helpers.py:131-147and:387-393(commit2d422720b). Therun_agent.pychanges in this PR therefore need to be dropped during salvage. - The retry gap is now in
agent/conversation_loop.py: 503/529 classify asoverloaded(agent/error_classifier.py:1033-1044), butoverloadedis excluded fromis_rate_limited(agent/conversation_loop.py:3141-3149), soRetry-Afteris not read (:4094-4113). - The proposed 180-second cap conflicts with current main's documented 600-second Retry-After ceiling at
agent/conversation_loop.py:4102-4107.
Suggested changes
- Re-scope the salvage to the current retry loop, preserve the 600-second cap, and add a conversation-loop test for a 503/529 overload with
Retry-After.
Automated hermes-sweeper review.
| upstream cluster has time to recover. Retry-After, when present, wins. | ||
| """ | ||
|
|
||
| normalized_reason = getattr(reason, "value", reason) or "" |
There was a problem hiding this comment.
Please do not introduce a separate 180s cap when salvaging this. Current main intentionally caps Retry-After at 600s because a 120s cap retried before known reset windows (agent/conversation_loop.py:4102-4107). Reuse or centralize that policy and cover an overload response with a Retry-After header.
GottZ
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Summary
Five PRs address overlapping retry and provider-handling failures: #47205/#52333 add named custom-provider matching and Z.AI-specific adaptive backoff, #59523/#60034 make that backoff reachable on the overloaded path, and #11462 combines an already-landed Codex timeout change with a still-distinct generic 503/529 Retry-After gap.
Related pull requests
- #11462
related— (+128/-10) — keep open with a salvage path: drop the Codex request-size/stale-timeout changes because commit2d422720balready implements them inagent/chat_completion_helpers.py:66-112,:131-147, and:387-393; retain and rework the generic overload handling inagent/conversation_loop.pyso 503/529 overloads read Retry-After while preserving the existing 600-second ceiling. This follows the contributor keep_open review rather than treating the current mixed diff as mergeable. - #47205 [closed]
related— (+237/-5) — already implemented on main: this closed PR addedcustom:<provider>extra_body matching and narrow adaptive backoff for Z.AI Coding Plan 429/1305 overloads; the discussion identifies equivalent upstream commit6f2b2a1f34, and #52333 is the merged salvage/reference implementation. - #52333 [merged]
related— (+238/-5) — merged reference implementation: it salvaged #47205 by adding named custom-provider extra_body matching and the Z.AI-specific 30/60/90/120-second overload policy, but its original gate left that policy unreachable for errors classified as overloaded and under the default retry ceiling. - #59523 [closed]
related— (+87/-4) — canonical twin, merged through #60034: it identified and fixed both reachability defects by running Z.AI 429/1305 handling on the overloaded path and raising the retry ceiling so the long tier executes. The contributor discussion confirms its commits were cherry-picked into #60034 with authorship preserved. - #60034 [merged]
related— (+96/-5) — merged reference for the #59523 fix: its diff carries the same overloaded-path routing and retry-ceiling mechanism, plus a shared short-attempt constant. The visible contributor triage review calls #59523 the canonical twin by creation time; #60034 is retained here only as the merged implementation, not as a replacement for that canonical designation.
Duplicates
#47205 and #52333 are substantially the same provider-matching and Z.AI adaptive-backoff change, with #52333 the merged salvage. #59523 and #60034 are twins; #59523 remains the contributor-designated canonical PR, while #60034 is the merged vehicle containing its commits plus the shared-constant refinement.
Suggested consolidation
Keep #11462 open with a salvage path: remove the Codex half already covered by commit 2d422720b, retarget the remaining generic 503/529 Retry-After fix to agent/conversation_loop.py, preserve the documented 600-second ceiling, and add a conversation-loop regression test. Treat closed #47205 as superseded by merged #52333, and closed #59523 as the canonical source twin whose implementation landed through merged #60034; no reopen or merge action is needed for those completed duplicate chains.
Cross-PR triage: Reviewed 5 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 54 kB of PR diffs, 9 kB of issue/PR text, 6 kB of discussion (7 comments), 0 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
Summary
input+instructions+tools, not justmessagesopenai-codexnon-streaming requestsRetry-AfterTest Plan