Skip to content

test(e2e): Drop OpenRouter's [DONE] frame in the Anthropic test app - #25594

Merged
nicohrubec merged 1 commit into
developfrom
isaacs/fix-e2e-anthropic-send-to-sentry
Oct 21, 2026
Merged

nicohrubec merged 1 commit into
developfrom
isaacs/fix-e2e-anthropic-send-to-sentry

Conversation

@isaacs

@isaacs isaacs commented Oct 21, 2026

Copy link
Copy Markdown
Member

The (latest) variant of node-anthropic-send-to-sentry fails on the streaming tests. OpenRouter ends each stream with an OpenAI-style event: data / data: [DONE] frame, which is not part of Anthropic's protocol. Up to 0.135.0, @anthropic-ai/sdk parsed only known event names and ignored this frame. Since 0.136.0 it parses every named event as JSON, so the frame makes it throw.

The test app now gives the client a fetch wrapper that removes the [DONE] frame from event streams. The test keeps the newest SDK, and the pinned variant still passes. Pinning the latest variant to 0.135.0 would also work, but it would stop the test from tracking new SDK releases.

The `(latest)` variant of `node-anthropic-send-to-sentry` fails on the
streaming tests. OpenRouter ends each stream with an OpenAI-style
`event: data` / `data: [DONE]` frame, which is not part of Anthropic's
protocol. Up to 0.135.0, `@anthropic-ai/sdk` parsed only known event
names and ignored this frame. Since 0.136.0 it parses every named event
as JSON, so the frame makes it throw.

The test app now gives the client a `fetch` wrapper that removes the
`[DONE]` frame from event streams. The test keeps the newest SDK, and
the pinned variant still passes. Pinning the latest variant to 0.135.0
would also work, but it would stop the test from tracking new SDK
releases.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@isaacs

isaacs commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

Another valid approach would be to pin the SDK to 0.135.0 and report the issue upstream, but I figure the whole point of the (latest) variant is that it tracks latest.

@nicohrubec nicohrubec left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an upstream docs issue that seems relevant but no replies so far: OpenRouterTeam/docs#1

I agree that it's better to work around this failure instead of pinning

@nicohrubec
nicohrubec merged commit 04b073e into develop Oct 21, 2026
45 checks passed
@nicohrubec
nicohrubec deleted the isaacs/fix-e2e-anthropic-send-to-sentry branch October 21, 2026 08:22
Sign up for free to 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.

2 participants