Skip to content

Anthropic message stream events unhandled #17734

Closed

Description

@adoxner

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

10.13.0

Framework Version

NodeJS 20.19.0

Link to Sentry event

No response

Reproduction Example/SDK Setup

Sentry.init({
      dsn: Config.SENTRY_DSN,
      integrations: [
        // Add the OpenAI integration
        Sentry.openAIIntegration({
          recordInputs: true,
          recordOutputs: true,
        }),
        Sentry.anthropicAIIntegration({
          recordInputs: true,
          recordOutputs: true,
        })
      ],
      tracesSampleRate: sampleRate,
      profilesSampleRate: sampleRate,
      environment: environmentName
    })

Steps to Reproduce

  1. Install @sentry/node v10.7.0 or later
  2. Initialize Anthropic
  3. Call anthropic.messages.stream() with streaming parameters using .on() event handlers
import Anthropic from '@anthropic-ai/sdk';

const client = new Anthropic();

const stream = await client.messages.stream(streamParams)
          .on('streamEvent', (messageStreamEvent, snapshot) => {
            // Handle streamEvent
          })

Expected Result

Call succeeds and sends message to Anthropic, while listening for streamEvent type.

Actual Result

Error thrown with message:

TypeError: this.anthropic.messages.stream(...).on is not a function

Additional Context

Event handlers (i.e. .on()) are consistent with Anthropic's docs on streaming messages using their Node SDK.

This worked fine in @sentry/node v10.6.0 but has been broken since v10.7.0. It may be related to this PR: #17460

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Activity

  1. linear commented on Sep 22, 2025

    @linear
  2. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Sep 22, 2025
  3. andreiborza commented on Sep 23, 2025

    @andreiborza
    Member

    Hi @adoxner, thank you for filing this, we'll investigate.

  4. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Sep 23, 2025
  5. added a commit that references this issue on Sep 25, 2025
    f4df972
  6. github-actions commented on Sep 29, 2025

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #17754, which was included in the 10.16.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions