feat(node): Add v7 support for vercelAiIntegration#21613
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 21822ce. Configure here.
| // `@sentry/opentelemetry/tracing-channel` as the factory so spans become the active OTel | ||
| // context via `bindStore` (giving correct parent/child nesting). That factory needs the Sentry | ||
| // OTel context manager, which `initOpenTelemetry()` registers after `setupOnce`, so defer a tick. | ||
| void Promise.resolve().then(() => subscribeVercelAiTracingChannel(otelTracingChannel)); |
There was a problem hiding this comment.
V7 never registers Vercel processors
High Severity
With ai v7, OTel instrumentation no longer patches the package, so callWhenPatched never runs. addVercelAiProcessors is only registered when shouldForce is true at afterAllSetup. If the Modules integration does not list ai then (typical for ESM before import or when ai is missing from cwd package.json dependencies), v7 channel spans are emitted but transaction processors never run—no tool descriptions, parent token rollup, or related enrichment.
Reviewed by Cursor Bugbot for commit 21822ce. Configure here.
size-limit report 📦
|


In the latest beta release of v7 of the ai package, native tracing channel events are now emitted. This PR adds support for this and thus for instrumentation in this package.
For now, this is only implemented in node, but can also be ported to deno/bun.
A big part of this PR was making sure that the v6 tests also run for v7 to make sure this is compatible. It may need some cleanup but tests pass now.
Supersedes #21584