fix(runtime): honor isRetryable flag in provider retry classifier - #3812
Open
0xMudit wants to merge 1 commit into
Open
fix(runtime): honor isRetryable flag in provider retry classifier#38120xMudit wants to merge 1 commit into
0xMudit wants to merge 1 commit into
Conversation
… retry classifier The AI SDK wraps TLS/transport failures as APICallError with isRetryable:true and a 'Cannot connect to API: <cause>' message. Maka's providerRetryMetadata did not check this flag or walk the cause chain, so these failures were classified as non-retryable and the turn exited immediately (apache#3756). - Check isRetryable on the error and up to 8 levels of cause chain - Add regression tests for the exact TLS message from the issue report - Add test for isRetryable on a wrapped cause error Generated-by: opencode/big-pickle
Astro-Han
reviewed
Aug 25, 2026
Astro-Han
left a comment
Contributor
There was a problem hiding this comment.
Update on b61f988a42:
[P2] isRetryableInChain ignores outer isRetryable:false, causes false retry
APICallError(400,false,cause=APICallError(true)) is judged retryable, sending a hard 4xx into up to 10 provider retries. Fix: give nearest explicit boolean (especially false) authority and add regression test.
Also P3: RetryError.lastError unwrapping inconsistency between classifier and helper — unify boundary.
简体中文
重试判断越过显式不可重试标记。
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
Fixes #3756
The AI SDK wraps TLS/transport failures as \APICallError\ with \isRetryable: true\ and a message like \Cannot connect to API: . Maka's \providerRetryMetadata\ did not check this flag or walk the \cause\ chain, so these failures were classified as non-retryable and the turn exited immediately.
Changes
ormalizeProviderError\ returns undefined.
Verification
pm --workspace @maka/runtime run build: passes
pm --workspace @maka/runtime test: 17/17 pass (including 2 new regression tests)
pm --workspace @maka/core test: 656/656 pass
pm run lint: passes
pm run format:check: passes
AI use
Tool(s) and scope: opencode/big-pickle — diagnosed root cause, implemented fix and regression tests
Checklist
Does this PR entail a change in behavior?