You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vercelAIIntegration: Record runtimeContext and toolContext on AI SDK v7 spans #25352
ai@7.0.114 filters runtimeContext and toolContext on the tracing channel by telemetry.includeRuntimeContext / includeToolsContext (vercel/ai#21447). The v7 subscriber (packages/server-utils/src/integrations/vercel-ai/vercel-ai-dc-subscriber.ts) does not read these fields yet.
Scope:
Set vercel.ai.settings.runtimeContext.<key> on the invoke_agent span for each key in event.runtimeContext.
Copy the same attributes to the child generate_content and execute_tool spans. Use the callId maps, because the child events do not carry runtimeContext.
Record event.toolContext on execute_tool spans.
Do not read these fields on ai < 7.0.114. Those versions send unfiltered context, which can contain secrets.
Done when:
Integration tests on ai@>=7.0.114 show that included keys are on all 3 span types and excluded keys are not.
A test on ai@7.0.113 (or a guard test) shows that no context attributes are set.
Open question: How do we detect the version? We can check the ai version or the event shape, or we can add a new min version for the v7 subscriber.
Activity
linear-code commentedon Oct 14, 2026
JS-3935
andreiborza commentedon Oct 14, 2026
It's a duplicate of the original issue.