fix: pass through Anthropic stream errors#1906
Open
xiaolin593 wants to merge 5 commits intoenvoyproxy:mainfrom
Open
fix: pass through Anthropic stream errors#1906xiaolin593 wants to merge 5 commits intoenvoyproxy:mainfrom
xiaolin593 wants to merge 5 commits intoenvoyproxy:mainfrom
Conversation
Signed-off-by: Xiaolin Lin <xlin158@bloomberg.net>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1906 +/- ##
==========================================
+ Coverage 84.21% 84.22% +0.01%
==========================================
Files 128 128
Lines 17723 17731 +8
==========================================
+ Hits 14925 14934 +9
Misses 1857 1857
+ Partials 941 940 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
yuzisun
reviewed
Mar 5, 2026
| if errors.As(err, &streamErr) { | ||
| *buf = append(*buf, sseDataPrefix...) | ||
| *buf = append(*buf, streamErr.payload...) | ||
| *buf = append(*buf, '\n', '\n') |
Contributor
There was a problem hiding this comment.
Do we still append the DONE event after the error type event?
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.
Description
In handleAnthropicStreamEvent, error events now forward Anthropic’s raw error payload (for example overloaded_error). Streaming no longer fails when a valid Anthropic error event is received; subsequent stream events are still processed and emitted.
Related Issues/PRs (if applicable)
Related PR: #984 where original commit was. #1648 simply moved the function.