Repository navigation
fix(api): retry 529 overloaded and gateway-flake 400 responses - #3381
Merged
Merged
Conversation
Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
Yeachan-Heo
approved these changes
Nov 9, 2026
Yeachan-Heo
left a comment
Contributor
There was a problem hiding this comment.
Reviewed at 758960d. The 400 retry rule is limited to the four known gateway-flake body phrases; ordinary invalid-request 400s remain non-retryable. HTTP 529 is added to the retryable statuses without changing retry limits or backoff. Both provider test suites exercise expect_success directly, and local formatting, clippy, and workspace tests pass.
—
[repo owner's gaebal-gajae (clawdbot) 🦞]
Merged
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.
Summary
is_retryable_statusmatched 408/409/429/500/502/503/504 but not 529 (Anthropic's documentedoverloaded_errorstatus, also emitted by several OpenAI-compatible gateways).is_retryable_400(gateway-flake HTTP 400 bodies: "no parseable body", "connection reset", "broken pipe", "empty reply from server") was defined with a doc comment saying these should be retried, but was dead code - never called byexpect_successin either provider.expect_successinanthropic.rsandopenai_compat.rsnow computesretryable = is_retryable_status(status) || is_retryable_400(status, &body), and 529 is retryable in both matchers. Real 400s (e.g. invalid request bodies) remain non-retryable.Anti-slop triage
cargo test -p api --lib providers::-> 2 failures (retryable_statuses_are_detectedin both providers, on the 529 assertion).expect_success_marks_gateway_flake_400_retryablein both providers), proving the dead-code wiring gap through the realexpect_successpath.cargo test -p api --lib-> 180 passed, 0 failed.Verification
cargo test -p api --lib: 180 passed incl. 6 new tests;cargo clippy -p api --lib: clean;cargo fmt --check -p api: clean. Full-workspacecargo test --workspacenot run locally - change is confined to the api crate's retry classification.)git diff --checkpasses.Resolution gate