Uh oh!
There was an error while loading. Please reload this page.
fix(ai): handle anthropic error events and ping frames - #44500
Merged
Conversation
- return Effect.fail for error events so stream properly fails instead of returning bare AIError - add ping to SSE allowlist to explicitly handle keepalive frames (matches SDK continue behavior)
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Parity fixes for Anthropic Messages protocol:
error handling:
onErrorpreviously returned bareAIErrorfromstep(protocol.stream.stepexpectsEffect<E, AIError>) — the error was swallowed instead of failing the stream. Now returnsEffect.fail(AIError)soRoute.streamPreparedcorrectly routes viaStream.catchCause -> AIErrorandrequireTerminalEvent. Matches SDKStream.fromSSEResponse:139 throws APIErrorbehavior.ping: Adds
pingtoSSE_EVENTSallowlist (Framing.sseEvents). Previously filtered implicitly at framing; now passes through tostepwhere it falls through toNO_EVENTS(explicitcontinuelike SDKstreaming.ts:135). PreservessseFramingempty-data filter soevent: ping\n\n(empty data per SDKstreaming.test.ts:68) remains dropped.Keeps ID scrubbing as requested.