Skip to content

Sentry Anthropic instrumentation breaks withResponse() #19912

Description

@jankalfus

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

10.45.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

The Anthropic SDK supports calling .withResponse() on the result of client.messages.create(), see https://platform.claude.com/docs/en/api/sdks/typescript#accessing-raw-response-data-e-g-headers. It seems that Sentry's integration does not maintain this API interface, since trying to call withResponse() on a wrapped result ends up with the error: result.withResponse is not a function

I believe this is the same issue as #19073, just for Anthropic instrumentation.

Steps to Reproduce

  1. Enable Anthropic integration (on by default)
  2. Call client.messages.create({ ... }).withResponse()
  3. Error is thrown.

Expected Result

Sentry's integration should not break this API.

Actual Result

result.withResponse is not a function

Additional Context

No response

Priority

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

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