fix(session): retry 5xx server errors even when isRetryable is unset#22511
Merged
kitlangton merged 3 commits intodevfrom Apr 16, 2026
Merged
fix(session): retry 5xx server errors even when isRetryable is unset#22511kitlangton merged 3 commits intodevfrom
kitlangton merged 3 commits intodevfrom
Conversation
Most LLM provider SDKs don't set isRetryable on plain 500/502/503 responses, so they fell through the retry policy and surfaced as terminal failures. Treat any 5xx status code as retryable since these are transient server-side errors.
jerome-benoit
pushed a commit
to jerome-benoit/opencode
that referenced
this pull request
Apr 16, 2026
xywsxp
pushed a commit
to xywsxp/opencode
that referenced
this pull request
Apr 24, 2026
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
isRetryable: trueContext
The AI SDK's built-in retry (
maxRetries) was disabled in Dec 2025 when the custom Effect-based retry policy took over. The oldmaxRetries: 10handled 5xx errors automatically, but the new customretryable()function only checkedisRetryable(which providers don't set for most 5xx) and text-matched rate limit patterns. This left a gap where transient 500s would fail immediately.