Skip to content

fix(core): Use ai.operationId for Vercel AI V6 operation name mapping#20285

Merged
nicohrubec merged 1 commit intodevelopfrom
nh/vercel-v6-toolagent-operation-name
Apr 14, 2026
Merged

fix(core): Use ai.operationId for Vercel AI V6 operation name mapping#20285
nicohrubec merged 1 commit intodevelopfrom
nh/vercel-v6-toolagent-operation-name

Conversation

@nicohrubec
Copy link
Copy Markdown
Member

Vercel AI SDK V6 appends functionId to the operation.name span attribute (e.g., ai.streamText myAgent), causing mapVercelAiOperationName to miss the exact-match lookup and leave gen_ai.operation.name unmapped. This fix uses the ai.operationId attribute (which always contains the bare operation like ai.streamText) when present, falling back to operation.name for older Vercel SDK versions. The existing ToolLoopAgent integration test is strengthened with a functionId to prevent regression.

Closes #20284

@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 25.73 kB - -
@sentry/browser - with treeshaking flags 24.22 kB - -
@sentry/browser (incl. Tracing) 42.72 kB - -
@sentry/browser (incl. Tracing, Profiling) 47.35 kB - -
@sentry/browser (incl. Tracing, Replay) 81.53 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 71.1 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 86.23 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 98.44 kB - -
@sentry/browser (incl. Feedback) 42.52 kB - -
@sentry/browser (incl. sendFeedback) 30.39 kB - -
@sentry/browser (incl. FeedbackAsync) 35.39 kB - -
@sentry/browser (incl. Metrics) 27.04 kB - -
@sentry/browser (incl. Logs) 27.19 kB - -
@sentry/browser (incl. Metrics & Logs) 27.86 kB - -
@sentry/react 27.48 kB - -
@sentry/react (incl. Tracing) 45.05 kB - -
@sentry/vue 30.56 kB - -
@sentry/vue (incl. Tracing) 44.58 kB - -
@sentry/svelte 25.75 kB - -
CDN Bundle 28.41 kB - -
CDN Bundle (incl. Tracing) 43.77 kB - -
CDN Bundle (incl. Logs, Metrics) 29.79 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 44.84 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 68.6 kB - -
CDN Bundle (incl. Tracing, Replay) 80.65 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 81.68 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 86.18 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 87.21 kB - -
CDN Bundle - uncompressed 83 kB - -
CDN Bundle (incl. Tracing) - uncompressed 129.82 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 87.14 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 133.24 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 210.13 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 246.7 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 250.1 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 259.61 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 263 kB - -
@sentry/nextjs (client) 47.48 kB - -
@sentry/sveltekit (client) 43.2 kB - -
@sentry/node-core 57.86 kB - -
@sentry/node 174.81 kB +0.02% +24 B 🔺
@sentry/node - without tracing 97.63 kB +0.01% +9 B 🔺
@sentry/aws-serverless 114.98 kB +0.01% +6 B 🔺

View base workflow run

@nicohrubec nicohrubec marked this pull request as ready for review April 14, 2026 14:43
Copy link
Copy Markdown
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

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

lgtm

@nicohrubec nicohrubec merged commit 47455a0 into develop Apr 14, 2026
465 of 477 checks passed
@nicohrubec nicohrubec deleted the nh/vercel-v6-toolagent-operation-name branch April 14, 2026 15:20
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.

Vercel AI V6 class-based agents have incorrect gen_ai.operation.name mapping

2 participants