Skip to content

Commit 0dae40f

Browse files
committed
fix vercel tests
1 parent 81df583 commit 0dae40f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/core/src/integrations/conversationId.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)