Skip to content

fix(ai): handle anthropic error events and ping frames - #44500

Merged
rekram1-node merged 1 commit into
v2from
anthropic-msgs-parity
Aug 23, 2026
Merged

fix(ai): handle anthropic error events and ping frames#44500
rekram1-node merged 1 commit into
v2from
anthropic-msgs-parity

Conversation

@rekram1-node

@rekram1-noderekram1-node commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Parity fixes for Anthropic Messages protocol:

  • error handling:onError previously returned bare AIError from step (protocol.stream.step expects Effect<E, AIError>) — the error was swallowed instead of failing the stream. Now returns Effect.fail(AIError) so Route.streamPrepared correctly routes via Stream.catchCause -> AIError and requireTerminalEvent. Matches SDK Stream.fromSSEResponse:139 throws APIError behavior.

  • ping: Adds ping to SSE_EVENTS allowlist (Framing.sseEvents). Previously filtered implicitly at framing; now passes through to step where it falls through to NO_EVENTS (explicit continue like SDK streaming.ts:135). Preserves sseFraming empty-data filter so event: ping\n\n (empty data per SDK streaming.test.ts:68) remains dropped.

Keeps ID scrubbing as requested.

- 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)
@rekram1-node
rekram1-node merged commit 6020f36 into v2Aug 23, 2026
11 checks passed
@rekram1-node
rekram1-node deleted the anthropic-msgs-parity branch August 23, 2026 18:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@rekram1-node