fix(proxy): suppress duplicate side-effect tool calls#586
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6a337e6aa9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
6a337e6 to
5911be5
Compare
|
Thanks @Komzpa -- the side-effect tool-call dedupe is exactly the right shape (per-response id cache, side-effect allowlist, P1 --
|
|
To use Codex here, create an environment for this repo. |
40ac23e to
85666c1
Compare
Fixes Soju06#565. Long-running Codex agent sessions stop mid-task when the upstream replies with "Our servers are currently overloaded. Please try again later" because classify_upstream_failure returns non_retryable for that envelope. OpenAI surfaces the overload condition with error.code = "overloaded_error". That code is missing from _TRANSIENT_CODES, and the envelope can arrive without an accompanying 5xx HTTP status (streamed Responses API traffic typically returns HTTP 200 before the error envelope hits the wire). With both signals absent the classifier falls through to non_retryable, and failover_decision only retries / fails over for retryable_transient, rate_limit, and quota. The request is failed back to the client and the agent stops without exercising the multi-account failover path that already exists in the load balancer. Add "overloaded_error" to _TRANSIENT_CODES so the classifier returns retryable_transient regardless of the HTTP status, and pin the behavior with a unit regression that uses the no-status shape. Document the requirement under the responses-api-compat capability since /v1/responses is the surface where this overload shape is most commonly observed.
(cherry picked from commit dc1bcb7)
(cherry picked from commit 5c74ede)
(cherry picked from commit 5f323ef)
(cherry picked from commit 994f2a0)
(cherry picked from commit b7f7a64)
(cherry picked from commit 858d0d7)
(cherry picked from commit 0dcd7c7)
(cherry picked from commit f9503fe)
(cherry picked from commit 99119a0)
(cherry picked from commit ec174a1)
…fix/suppress-duplicate-side-effect-tool-calls-rebuild
…fix/suppress-duplicate-side-effect-tool-calls-rebuild
7beee93 to
df2d161
Compare
Summary
call_idmulti_tool_use.parallelbefore forwarding the batch to the clientValidation
uv run ruff check app/modules/proxy/service.py tests/unit/test_proxy_utils.pyuv run ty check app/modules/proxy/service.py tests/unit/test_proxy_utils.pyuv run pytest tests/unit/test_proxy_utils.py -q -k 'tool_call or stream_responses_keeps_distinct_http_tool_calls_across_response_ids or stream_responses_suppresses_same_response_http_tool_call_replay or parallel_tool'\n\nSplit from fix(proxy): trim Codex websocket full-replay continuations #555.