Retry Google 499 CANCELLED as transient#2566
Merged
hiroshinishio merged 1 commit intomainfrom Apr 21, 2026
Merged
Conversation
Google's GenAI backend emits 499 CANCELLED when it closes the stream server-side, observed in the 2026-04-20 free-tier overload window on gitautoai/website (AGENT-3JX/3JY/3K0/3JZ). No Retry-After hint is provided, so route through is_transient_error's linear backoff rather than the rate-limit path. Also updates CLAUDE.md to simplify the sentry-cli workflow and roll up two minor partial-assertion fixups from the prior rate-limit work.
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
getattr(err, "code", None) == 499tois_transient_errorso Google'sClientError: 499 CANCELLEDflows through the existing linear-backoff transient-retry path (2s/4s/6s, 3 attempts)google_errors.ClientErrorshape: positive for 499 CANCELLED, negative for 400 INVALID_ARGUMENT (to prove we don't retry real client bugs)Social Media Post (GitAuto)
Google 499 CANCELLED errors now retry instead of bubbling to Sentry
Social Media Post (Wes)
Gemini's free-tier has two flavors of overload: 429 with a "retry in 60s" hint, and 499 CANCELLED with no hint at all. Same Sentry cluster, same repo, 1 hour apart. Four lines plus two tests to make 499 take the transient-retry path we already had. Overload windows self-heal now.