René's URL Explorer Experiment


Title: Anthropic tool runner and message threads drop `gen_ai.chat` spans on `@anthropic-ai/sdk` >=1.2.0 · Issue #25816 · getsentry/sentry-javascript · GitHub

Open Graph Title: Anthropic tool runner and message threads drop `gen_ai.chat` spans on `@anthropic-ai/sdk` >=1.2.0 · Issue #25816 · getsentry/sentry-javascript

X Title: Anthropic tool runner and message threads drop `gen_ai.chat` spans on `@anthropic-ai/sdk` >=1.2.0 · Issue #25816 · getsentry/sentry-javascript

Description: On @anthropic-ai/sdk 1.2.0 and newer, calls made through beta.messages.toolRunner() or beta.messages.thread() produce no gen_ai.chat spans. gen_ai.execute_tool spans still show up. This is the follow-up mentioned in #25750. I ran the eag...

Open Graph Description: On @anthropic-ai/sdk 1.2.0 and newer, calls made through beta.messages.toolRunner() or beta.messages.thread() produce no gen_ai.chat spans. gen_ai.execute_tool spans still show up. This is the foll...

X Description: On @anthropic-ai/sdk 1.2.0 and newer, calls made through beta.messages.toolRunner() or beta.messages.thread() produce no gen_ai.chat spans. gen_ai.execute_tool spans still show up. This is the foll...

Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/25816

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Anthropic tool runner and message threads drop `gen_ai.chat` spans on `@anthropic-ai/sdk` >=1.2.0","articleBody":"On `@anthropic-ai/sdk` 1.2.0 and newer, calls made through `beta.messages.toolRunner()` or `beta.messages.thread()` produce no `gen_ai.chat` spans. `gen_ai.execute_tool` spans still show up. This is the follow-up mentioned in #25750.\n\nI ran the eager streaming tool runner scenario from `suites/tracing/anthropic/v0.129` against several versions with the range widened to `\u003c2`:\n\n| SDK version | `gen_ai.chat` spans | `gen_ai.execute_tool` spans |\n| --- | --- | --- |\n| 0.133.0, 0.137.0, 1.0.0, 1.1.0 | 2 | 2 |\n| 1.2.0, 1.3.0 | 0 | 2 |\n\n**Cause.** 1.2.0 added message threads, which are on by default for the first-party `Anthropic` client (`_supportsMessageThreads = true`). The tool runner now sends each turn through `BetaMessageThread._createWithRecovery`, which still calls `beta.messages.create()`, so our `chat` channel opens a span. But the thread then awaits `request._responseProps()` and builds its own `APIPromise` from the raw props. `wrapApiPromiseResponse` (`packages/server-utils/src/ai/core/apiPromise.ts`) only ends the span from `parseResponse` or `asResponse()`, and neither runs on that path. The span is opened but never ended, so it is never sent.\n\nRequests that fail still end the span, through the `asResponse()` error handler.\n\n**Scope.** This affects every `toolRunner()` call and any direct `thread().send()` on the default client from 1.2.0 on. Bedrock and Vertex clients don't support threads, so they should not be affected (not verified).\n\n**Fix direction.** End the span from the response props as well, for example by also observing `_responseProps()`. The streaming case is harder: the thread builds the `Stream` itself, so we would need to hook that stream to record usage and end the span when it finishes.\n","author":{"url":"https://github.com/chargome","@type":"Person","name":"chargome"},"datePublished":"2026-10-28T13:13:17Z","url":"https://github.com/getsentry/sentry-javascript/issues/25816"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:98e33e6b-248a-a2b8-8186-89d4b49b902c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD0F0:159911:27A85:37133:6B041606
html-safe-nonce8bf07516d099a9c9d21e1ce1b8115629689bb8f9c870a781a51073cb18b9466d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMEYwOjE1OTkxMToyN0E4NTozNzEzMzo2QjA0MTYwNiIsInZpc2l0b3JfaWQiOiI2NzA3MDI5MzE5MzAwMTU4OTgyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac3bc44571a0d5bf4081a6675b76465c753c3cf490010ffd95fe82555cd5228c35
hovercard-subject-tagissue:6079632793
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/25816/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a3465d53c60ba7cd9e8b45923d8058e101493c8c9f8096473237e00269a2ef48/getsentry/sentry-javascript/issues/25816
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a3465d53c60ba7cd9e8b45923d8058e101493c8c9f8096473237e00269a2ef48/getsentry/sentry-javascript/issues/25816
og:image:altOn @anthropic-ai/sdk 1.2.0 and newer, calls made through beta.messages.toolRunner() or beta.messages.thread() produce no gen_ai.chat spans. gen_ai.execute_tool spans still show up. This is the foll...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamechargome
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3328572
octolytics-dimension-repository_nwogetsentry/sentry-javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3328572
octolytics-dimension-repository_network_root_nwogetsentry/sentry-javascript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/25816#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F25816
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F25816
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-javascript
Reloadhttps://github.com/getsentry/sentry-javascript/issues/25816
Reloadhttps://github.com/getsentry/sentry-javascript/issues/25816
Reloadhttps://github.com/getsentry/sentry-javascript/issues/25816
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues340 (340)https://github.com/getsentry/sentry-javascript/issues
Pull requests53 (53)https://github.com/getsentry/sentry-javascript/pulls
Discussionshttps://github.com/getsentry/sentry-javascript/discussions
Actionshttps://github.com/getsentry/sentry-javascript/actions
Security and quality7 (7)https://github.com/getsentry/sentry-javascript/security
Insightshttps://github.com/getsentry/sentry-javascript/insights
https://github.com/getsentry/sentry-javascript
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/25816
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/25816
#25931https://github.com/getsentry/sentry-javascript/pull/25931
Anthropic tool runner and message threads drop gen_ai.chat spans on @anthropic-ai/sdk >=1.2.0https://github.com/getsentry/sentry-javascript/issues/25816#top
#25931https://github.com/getsentry/sentry-javascript/pull/25931
https://github.com/RulaKhaled
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
https://github.com/chargome
chargomehttps://github.com/chargome
on Oct 28, 2026https://github.com/getsentry/sentry-javascript/issues/25816#issue-6079632793
#25750https://github.com/getsentry/sentry-javascript/pull/25750
chargomehttps://github.com/chargome
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Oct 28, 2026https://github.com/getsentry/sentry-javascript/issues/25816#event-34477004148
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Oct 28, 2026https://github.com/getsentry/sentry-javascript/issues/25816#issuecomment-6469918907
Linear Codehttps://linear.app
JS-4030https://linear.app/getsentry/issue/JS-4030
linear-codehttps://github.com/apps/linear-code
Spanshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Spans%22
on Oct 28, 2026https://github.com/getsentry/sentry-javascript/issues/25816#event-34477057499
chargomehttps://github.com/chargome
Spanshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Spans%22
on Oct 28, 2026https://github.com/getsentry/sentry-javascript/issues/25816#event-34477072468
RulaKhaledhttps://github.com/RulaKhaled
on Oct 30, 2026https://github.com/getsentry/sentry-javascript/issues/25816#event-34681523996
RulaKhaledhttps://github.com/RulaKhaled
on Nov 2, 2026https://github.com/getsentry/sentry-javascript/issues/25816#event-34917487370
fix(server-utils): Record Anthropic chat spans for thread and tool-ru…https://github.com/getsentry/sentry-javascript/commit/d20862cebd2f9232a259305abf7ab5cf81de7c15
https://docs.github.com/articles/closing-issues-via-commit-messages
d20862chttps://github.com/getsentry/sentry-javascript/commit/d20862cebd2f9232a259305abf7ab5cf81de7c15
fix(server-utils): Record Anthropic chat spans for thread and tool-ru…https://github.com/getsentry/sentry-javascript/commit/f5bdf2b75d3b1bfaac3d2316ab87cf035d39dc1c
https://docs.github.com/articles/closing-issues-via-commit-messages
f5bdf2bhttps://github.com/getsentry/sentry-javascript/commit/f5bdf2b75d3b1bfaac3d2316ab87cf035d39dc1c
fix(server-utils): Record Anthropic chat spans for thread and tool-ru…https://github.com/getsentry/sentry-javascript/commit/222e475efda6edbbcc5a3fe59a044733110fff0c
https://docs.github.com/articles/closing-issues-via-commit-messages
222e475https://github.com/getsentry/sentry-javascript/commit/222e475efda6edbbcc5a3fe59a044733110fff0c
fix(server-utils): Record Anthropic chat spans for thread and tool-ru…https://github.com/getsentry/sentry-javascript/commit/595b385feeb77a917077d045bf7a25f9ebebc755
https://docs.github.com/articles/closing-issues-via-commit-messages
595b385https://github.com/getsentry/sentry-javascript/commit/595b385feeb77a917077d045bf7a25f9ebebc755
isaacshttps://github.com/isaacs
on Nov 10, 2026https://github.com/getsentry/sentry-javascript/issues/25816#event-35677690297
fix(server-utils): Record Anthropic chat spans for thread and tool-ru…https://github.com/getsentry/sentry-javascript/commit/41d2b587f621b41327e1b95d76c3942096d821d9
https://docs.github.com/articles/closing-issues-via-commit-messages
41d2b58https://github.com/getsentry/sentry-javascript/commit/41d2b587f621b41327e1b95d76c3942096d821d9
RulaKhaledhttps://github.com/RulaKhaled
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#25931https://github.com/getsentry/sentry-javascript/pull/25931
on Nov 10, 2026https://github.com/getsentry/sentry-javascript/issues/25816#event-35710693156
RulaKhaledhttps://github.com/RulaKhaled
on Nov 10, 2026https://github.com/getsentry/sentry-javascript/issues/25816#event-35710695662
fix(server-utils): Record Anthropic chat spans for thread and tool-ru…https://github.com/getsentry/sentry-javascript/commit/bcf7aea42e19f3191a1e7383da7e14a14ba1df5a
https://docs.github.com/articles/closing-issues-via-commit-messages
bcf7aeahttps://github.com/getsentry/sentry-javascript/commit/bcf7aea42e19f3191a1e7383da7e14a14ba1df5a
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
on Nov 16, 2026https://github.com/getsentry/sentry-javascript/issues/25816#issuecomment-6922351930
GitHub Actionshttps://help.github.com/en/actions
#25931https://github.com/getsentry/sentry-javascript/pull/25931
11.13.0 releasehttps://github.com/getsentry/sentry-javascript/releases/tag/11.13.0
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/25816
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/25816
RulaKhaledhttps://github.com/RulaKhaled
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.