Repository navigation
fix(adk): bypass retry for mid-stream graph interruptions - #1478
Open
1828703450qqcom-ux wants to merge 1 commit into
Open
1828703450qqcom-ux wants to merge 1 commit into
1828703450qqcom-ux wants to merge 1 commit into
Conversation
The Generate retry path already checks compose.ExtractInterruptInfo and returns immediately for interrupt errors. The stream retry paths (both ShouldRetry and legacy) did not, so a graph interruption delivered by a model stream was treated as a retryable error and the next attempt's output replaced the original interruption (issue cloudwego#1446). Add the same interrupt check to the stream error handling in both streamWithShouldRetry and streamLegacy.
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.
fix(adk): bypass retry for mid-stream graph interruptions
Fixes #1446
Summary
Generateretry path already checkscompose.ExtractInterruptInfo(err)and returns immediately for interrupt errors. The stream retry paths
(both
ShouldRetryand legacy) did not — a graph interruption delivered bya model stream was treated as a retryable error, and the next attempt's
output replaced the original interruption.
streamWithShouldRetryandstreamLegacy.Reproduction
From the issue, with a model whose first
Stream()call emits one chunk thenan interrupt error, and a second call that succeeds:
main: the retry layer calls the model a second time and returns thesecond attempt's output. The interruption is lost.
Fix
adk/retry_chatmodel.go— two hunks, both adding the same pattern afterstream error consumption and before the retry decision:
streamWithShouldRetry: added aftertypedConsumeStreamand beforeShouldRetryis called.streamLegacy: added afterconsumeStreamForErrorand beforeisRetryAbleis called.The Generate path (both ShouldRetry and legacy) already has the same check
and is unchanged.
Validation
go test ./adk/ -count=1 -timeout 120s→ ok (49s).go test ./adk/ -run "Retry|Stream" -count=1).Scope
adk/retry_chatmodel.go(two hunks in stream retry paths).or any other logic beyond interrupt bypass.