Repository navigation
fix(vercel-ai-sdk): don't retry provider errors the AI SDK marks as not retryable - #466
Merged
Merged
Conversation
This was referenced Nov 11, 2026
moetemp
marked this pull request as ready for review
November 11, 2026 21:57
brianstrauch
left a comment
Member
There was a problem hiding this comment.
One retry-policy compatibility issue with retryable streamed errors.
brianstrauch
left a comment
Member
There was a problem hiding this comment.
One remaining provider error-type compatibility issue.
A 400 or 401 from the provider fails the same way on every attempt, and the default retry policy never stops.
A retry policy with Error in nonRetryableErrorTypes stopped these failures before, and a new type would make it retry them.
A handler that matches the type of a failed model call must continue to match. Only the retry verdict changes.
moetemp
force-pushed
the
fix/vercel-ai-sdk-non-retryable-errors
branch
from
November 12, 2026 07:27
b5e2271 to
45edc38
Compare
brianstrauch
approved these changes
Nov 12, 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.
What changed?
This PR stops Temporal from retrying provider errors that the AI SDK marks as not retryable.
APICallErrorwithisRetryable: false(a 400 or a 401, for example) now fails the three model Activities with a non-retryableApplicationFailure. The original error is thecause.APICallErrorin a streamederrorpart.errorpart usesgetErrorMessage, so an object doesn't print as[object Object].APICallError, and a streamederrorpart keepsError.Fixes #AI-948
Why?
A bad API key or a malformed request fails the same way on every attempt. With the default retry policy, the Activity retried it forever.
I used
isRetryablebecause the AI SDK's ownmaxRetrieslogic uses it too.A user who relied on retries for a 401, during a key rotation for example, now gets a failed Workflow on the first attempt. Recorded histories replay the same.
How did you test it?
make lintandmake testpass intypescript/vercel-ai-sdk.