fix(codex): retry transient backend errors and restore web search in …#637
Merged
Conversation
…Responses shim The Codex Responses shim called the Ark backend with num_retries=0 and no timeout, so a transient 429/5xx/overloaded error or a stalled connection failed the turn outright — the eval client's read timeout fired before any recovery (surfacing as ReadTimeout). It also stripped Codex's hosted web_search before Ark (Ark rejects its schema) with nothing replacing it, leaving Codex+Ark agents with no web capability. - num_retries is now env-tunable (CODEX_SHIM_NUM_RETRIES, default 2) so litellm applies exponential backoff; add an optional per-call timeout (CODEX_SHIM_TIMEOUT, default off). - Behind CODEX_SHIM_MAX_TOOL_ITERS (default 0 = off, byte-identical to before), translate the hosted web_search/web_fetch into Ark-accepted function tools and run a bounded shim-internal tool loop that executes the veADK builtins and feeds results back, so the agent regains web search. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
pre-commit ruff-format collapsed a multi-line .extend() call in the web-tool translation block; no behavior change.
warm-wm
approved these changes
Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…Responses shim
The Codex Responses shim called the Ark backend with num_retries=0 and no timeout, so a transient 429/5xx/overloaded error or a stalled connection failed the turn outright — the eval client's read timeout fired before any recovery (surfacing as ReadTimeout). It also stripped Codex's hosted web_search before Ark (Ark rejects its schema) with nothing replacing it, leaving Codex+Ark agents with no web capability.