Skip to content

feat(openinference-vercel): AI sdk v6#2684

Merged
cephalization merged 13 commits intomainfrom
cephalization/ai-sdk-6
Feb 10, 2026
Merged

feat(openinference-vercel): AI sdk v6#2684
cephalization merged 13 commits intomainfrom
cephalization/ai-sdk-6

Conversation

@cephalization
Copy link
Contributor

@cephalization cephalization commented Feb 3, 2026

Note

Medium Risk
Changes core span attribute conversion and span processor behavior (status/renaming) for AI SDK traces, which could affect exported telemetry shape and error reporting across versions.

Overview
Adds AI SDK v6 telemetry support to @arizeai/openinference-vercel by preferring standard gen_ai.* attributes (converted via new dependency @arizeai/openinference-genai) and falling back to Vercel ai.* attributes for span kind detection, embeddings, tool calls, metadata, streaming metrics, and message IO.

Introduces trace-level aggregation (TraceAggregateManager) so AI SDK root spans are renamed to operation.name and get an OK/ERROR status derived from child spans/finish reasons/exception events, while keeping existing status untouched when explicitly set.

Updates Vercel semantic convention constants (adds v6 fields + VercelAISemanticConventions re-export), adjusts span-kind mappings (top-level generate*/stream* now AGENT), refreshes tests to use real AI SDK v6 span fixtures, and adds scripts/examples for capturing and demoing v6 telemetry. Also standardizes package test scripts to vitest run and pins openinference-mastra deps/works around OTel v1 vs v2 typing when calling Vercel utils.

Written by Cursor Bugbot for commit a7c61c9. This will update automatically on new commits. Configure here.

@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Feb 3, 2026
@cephalization cephalization changed the title Cephalization/ai sdk 6 feat(openinference-vercel): AI sdk v6 Feb 3, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 3, 2026

Open in StackBlitz

@arizeai/openinference-core

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-core@2684

@arizeai/openinference-genai

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-genai@2684

@arizeai/openinference-instrumentation-anthropic

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-anthropic@2684

@arizeai/openinference-instrumentation-bedrock

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-bedrock@2684

@arizeai/openinference-instrumentation-bedrock-agent-runtime

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-bedrock-agent-runtime@2684

@arizeai/openinference-instrumentation-beeai

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-beeai@2684

@arizeai/openinference-instrumentation-langchain

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-langchain@2684

@arizeai/openinference-instrumentation-langchain-v0

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-langchain-v0@2684

@arizeai/openinference-instrumentation-mcp

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-mcp@2684

@arizeai/openinference-instrumentation-openai

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-openai@2684

@arizeai/openinference-mastra

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-mastra@2684

@arizeai/openinference-semantic-conventions

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-semantic-conventions@2684

@arizeai/openinference-vercel

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-vercel@2684

commit: a7c61c9

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

1 similar comment
@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Update test to use ai.embed (which maps to CHAIN) instead of
ai.generateText (which now maps to AGENT) to properly test that
token counts are not mapped for CHAIN spans.
@cephalization cephalization merged commit 912cdbe into main Feb 10, 2026
10 checks passed
@cephalization cephalization deleted the cephalization/ai-sdk-6 branch February 10, 2026 17:38
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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.

async forceFlush(): Promise<void> {
this.aggregateManager.clear();
return super.forceFlush();
}
Copy link

Choose a reason for hiding this comment

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

forceFlush clears in-flight trace aggregate state

Medium Severity

forceFlush() calls this.aggregateManager.clear(), which destroys all in-flight trace aggregate state. Unlike shutdown(), forceFlush is a non-destructive operation that can be called any time (e.g., periodic intervals, Lambda shutdown hooks). If called while a trace is in progress — after a child span with an error has ended but before the root span ends — the root span's status will remain UNSET instead of being set to ERROR or OK, because the aggregate error tracking data was wiped. The clear() call belongs only in shutdown().

Additional Locations (1)

Fix in Cursor Fix in Web

@github-actions
Copy link
Contributor

Code review

Found 2 CLAUDE.md compliance issues:

1. npm lockfile in scripts directory

File: js/packages/openinference-vercel/scripts/package-lock.json

This is an npm lockfile (package-lock.json), but the repository requires using pnpm exclusively.

Per CLAUDE.md:81 and js/CLAUDE.md:14:

MUST use pnpm, not npm

This file should be deleted, and dependencies for the scripts directory should be managed using pnpm instead.

2. npx usage in script comment

File: js/packages/openinference-vercel/scripts/capture-v6-spans.ts (line 7)

The comment instructs users to use npx tsx, but should use pnpx tsx instead.

Per CLAUDE.md:81 and js/CLAUDE.md:14:

MUST use pnpm, not npm

Change: * Run with: npx tsx scripts/capture-v6-spans.ts
To: * Run with: pnpx tsx scripts/capture-v6-spans.ts


No bugs found in the code changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants