Skip to content

ref(node): Stop tracing messages.countTokens in Anthropic AI - #23205

Merged
nicohrubec merged 5 commits into
developfrom
feat/anthropic-drop-count-tokens
Aug 10, 2026
Merged

ref(node): Stop tracing messages.countTokens in Anthropic AI#23205
nicohrubec merged 5 commits into
developfrom
feat/anthropic-drop-count-tokens

Conversation

@nicohrubec

@nicohrubec nicohrubec commented Aug 10, 2026

Copy link
Copy Markdown
Member

messages.countTokens only counts tokens and runs no model inference, so the Anthropic integration no longer emits a span for it.

Fixes #23148

`messages.countTokens` is a pre-flight token count with no model inference,
so we no longer emit a span for it. Removes the method from both the
monkey-patch registry and the orchestrion config, plus the now-dead
`input_tokens` response branch and type members.

Fixes #23148

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 30.35 kB - -
@sentry/browser - with treeshaking flags 28.52 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.85 kB - -
@sentry/browser (incl. Tracing) 48.63 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.64 kB - -
@sentry/browser (incl. Tracing, Profiling) 53.48 kB - -
@sentry/browser (incl. Tracing, Replay) 88.06 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.47 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.78 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.47 kB - -
@sentry/browser (incl. Feedback) 47.69 kB - -
@sentry/browser (incl. sendFeedback) 35.18 kB - -
@sentry/browser (incl. FeedbackAsync) 40.33 kB - -
@sentry/browser (incl. Metrics) 31.43 kB - -
@sentry/browser (incl. Logs) 31.66 kB - -
@sentry/browser (incl. Metrics & Logs) 32.34 kB - -
@sentry/react 32.14 kB - -
@sentry/react (incl. Tracing) 50.83 kB - -
@sentry/vue 35.45 kB - -
@sentry/vue (incl. Tracing) 50.6 kB - -
@sentry/svelte 30.38 kB - -
CDN Bundle 32.32 kB - -
CDN Bundle (incl. Tracing) 49.6 kB - -
CDN Bundle (incl. Logs, Metrics) 33.84 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.9 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74.38 kB - -
CDN Bundle (incl. Tracing, Replay) 87.13 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.41 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.94 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.19 kB - -
CDN Bundle - uncompressed 95.83 kB - -
CDN Bundle (incl. Tracing) - uncompressed 148.84 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.42 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.82 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.34 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 268.09 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 272.06 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 281.79 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.74 kB - -
@sentry/nextjs (client) 53.41 kB - -
@sentry/sveltekit (client) 49.04 kB - -
@sentry/core/server 65.7 kB - -
@sentry/core/browser 52.02 kB - -
@sentry/node 119.19 kB -0.04% -41 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 83.21 kB -0.04% -26 B 🔽
@sentry/aws-serverless 92.49 kB -0.03% -27 B 🔽
@sentry/cloudflare (withSentry) - minified 214.91 kB - -
@sentry/cloudflare (withSentry) 530.62 kB - -

View base workflow run

nicohrubec and others added 4 commits August 10, 2026 10:36
The LangGraph `create_agent` removal is the same class of change (an AI
integration no longer tracing a non-inference operation), so merge it into
the umbrella entry instead of keeping a separate, redundant section.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
End the sentence at "such as:" and let the bullets enumerate the
non-inference operations, instead of listing them twice.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…llet

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nicohrubec
nicohrubec marked this pull request as ready for review August 10, 2026 09:31
@nicohrubec
nicohrubec requested review from a team as code owners August 10, 2026 09:31
@nicohrubec
nicohrubec requested review from JPeer264, andreiborza and mydea and removed request for a team August 10, 2026 09:31
@nicohrubec
nicohrubec merged commit 32da17c into develop Aug 10, 2026
229 checks passed
@nicohrubec
nicohrubec deleted the feat/anthropic-drop-count-tokens branch August 10, 2026 10:06
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.

Stop tracing messages.countTokens in Anthropic AI integration

2 participants