Skip to content

fix(llm): Retry proxy upstream failures as transient#843

Merged
JeanMertz merged 2 commits into
mainfrom
retry-upstream
Jul 4, 2026
Merged

fix(llm): Retry proxy upstream failures as transient#843
JeanMertz merged 2 commits into
mainfrom
retry-upstream

Conversation

@JeanMertz

Copy link
Copy Markdown
Collaborator

Some proxy and gateway errors between the client and the provider report failures in bodies that don't match any provider's error envelope, so they land in the catch-all StreamErrorKind::Other bucket and were treated as non-retryable. Retrying these usually succeeds since the failure is on the network path, not the request itself.

StreamError::is_retryable now also checks Other-kind errors for transient network patterns in the error message, such as "upstream unreachable", "no healthy upstream", "upstream connect error" (envoy-style proxies), and "network is unreachable" / "host unreachable" (transport errors). Errors matching these patterns are now retried automatically instead of surfacing as a hard failure.

JeanMertz added 2 commits July 4, 2026 19:47
Some proxy and gateway errors between the client and the provider
report failures in bodies that don't match any provider's error
envelope, so they land in the catch-all `StreamErrorKind::Other`
bucket and were treated as non-retryable. Retrying these usually
succeeds since the failure is on the network path, not the request
itself.

`StreamError::is_retryable` now also checks `Other`-kind errors for
transient network patterns in the error message, such as "upstream
unreachable", "no healthy upstream", "upstream connect error"
(envoy-style proxies), and "network is unreachable" / "host
unreachable" (transport errors). Errors matching these patterns are
now retried automatically instead of surfacing as a hard failure.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz merged commit 80b7fa0 into main Jul 4, 2026
16 checks passed
@JeanMertz JeanMertz deleted the retry-upstream branch July 4, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant