File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/core/src/integrations Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,13 @@ const _conversationIdIntegration = (() => {
1919 const conversationId = scopeData . conversationId || isolationScopeData . conversationId ;
2020
2121 if ( conversationId ) {
22- // Only apply conversation ID to gen_ai spans
23- if ( ! spanToJSON ( span ) . op ?. startsWith ( 'gen_ai.' ) ) {
22+ const { op, data : attributes , description : name } = spanToJSON ( span ) ;
23+
24+ // Only apply conversation ID to gen_ai spans.
25+ // We also check for Vercel AI spans (ai.operationId attribute or ai.* span name)
26+ // because the Vercel AI integration sets the gen_ai.* op in its own spanStart handler
27+ // which fires after this, so the op is not yet available at this point.
28+ if ( ! op ?. startsWith ( 'gen_ai.' ) && ! attributes [ 'ai.operationId' ] && ! name ?. startsWith ( 'ai.' ) ) {
2429 return ;
2530 }
2631
You can’t perform that action at this time.
0 commit comments