SIGN IN SIGN UP

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

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 https://github.com/getsentry/sentry-javascript/issues/20284
N
Nicolas Hrubec committed
47455a0014116807b9e60f5f8c902e8cecf7dd75
Parent: f9b07ca
Committed by GitHub <noreply@github.com> on 4/14/2026, 3:20:14 PM