Retry transient Responses failures across request paths - #3
Open
lawrencecchen wants to merge 41 commits into
Open
Retry transient Responses failures across request paths#3lawrencecchen wants to merge 41 commits into
lawrencecchen wants to merge 41 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Retries transient request failures across safe replayable paths: sampling, legacy and streaming remote compaction, model requests after tool results, realtime calls, MCP operations, OAuth refresh, Guardian sampling, and Codex Apps startup reconnect. The exact provider message
Selected model is at capacity. Please try a different model.is classified as capacity and retried.The shared classifier separates transient transport, network, overload, rate-limit, cancellation, and websocket failures from permanent authentication, authorization, invalid-request, quota, policy, TLS, and malformed-response failures. Capacity uses jittered exponential backoff capped at 60 seconds with a 100-attempt budget. Other transient failures have finite operation budgets. Every retry emits a UI-only status with operation, delay, disposition, and attempt. The status is excluded from model history and request input. Completed tool output is preserved across a model-request retry. Subagents use the same turn-scoped notifier and retry loop.
Server cancellation remains retryable. Caller cancellation and deadlines remain terminal. WebSocket protocol and policy closes remain terminal even when their reason text contains capacity words. Requests with one-shot bodies or ambiguous side effects are not replayed when replay cannot be proven safe.
Behavior coverage includes the exact latest capacity body, nested overload envelopes, slow-down responses, 429 outer-budget exhaustion, network and websocket failures, remote compaction, server cancellation, caller cancellation, tool continuation, subagent status, permanent-error precedence, successful-response preservation, the Hyper
operation was canceledbranch, retry-marked permanent provider errors, and over-budget capacity counters.Focused verification passed:
Red and green regression pairs include:
a12f94d406->55ffde6a653563b36429->bb40bea9afdc906bd19b->4dcba7b64b3a94675e7->19e4126414606036ffed->707673f916d05955a677->3527561eb8630303b7c0->ef7f16071d473be5595d->891d3de60dThe optimized arm64 release build passed with Cargo's optimized profile,
opt-level=3, thin LTO, four codegen units, and line-table debug info. Source head:891d3de60d6cabafb37b052feae522ea3edb09fe. Installed binary:/Users/lawrence/.local/bin/codex, pointing to the commit-named artifact under/Users/lawrence/.local/libexec/codex-persistent-capacity-retries/. Release and installed SHA-256:9b8f46f44ad8a9cfec23b2db8a9c9a66f1baad5313a054a135e831f5e670baf8.Hosted checks that are not code failures remain:
cargo-denyreports baselineRUSTSEC-2026-0258forh2 0.4.13; SDK and Windows gnullvm jobs cannot find the requiredcodex-runnersgroup; Linux and macOS Bazel jobs reach the hosted timeout. Local Bazel lock update is unavailable because Bazel is not installed. Main build, format, cargo shear, spelling, blob-size, metadata, and socket checks pass.Residual scope is deliberate: file blob upload bodies are one-shot, memory-summary status has no notifier at that API boundary, generic client sleep has no cancellation token, Guardian prewarm is fail-fast, and custom MCP event streams are not replayed. These paths remain bounded or terminal when replay is unsafe.