-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(core): Add scope-level conversation ID API to support linking AI conversations #18909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): Add scope-level conversation ID API to support linking AI conversations #18909
Conversation
size-limit report 📦
|
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|
Lms24
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the changes! LGTM now!
In the future, we also might want to export conversationIdIntegration from SDKs but as long as there's nothing to configure, I think it's fine to leave it unexported. Happy to leave that up to you :)
…rysetconversationid-api
…rysetconversationid-api
There was a problem hiding this 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.
|
|
||
| if (conversationId) { | ||
| span.setAttribute(GEN_AI_CONVERSATION_ID_ATTRIBUTE, conversationId); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Integration uses spanStart instead of agreed spanEnd hook
High Severity
The integration uses client.on('spanStart', ...) but the PR discussion explicitly agreed on client.on('spanEnd', ...). With spanStart, the scope's conversation ID is set first, then auto-detected values from OpenAI/LangGraph integrations override it during span execution. The PR description states scope-level values should "override any automatically detected value" which requires spanEnd so the scope value is applied last and takes precedence.
Introduces a new
Sentry.setConversationId()API to track multi turn AI conversations across API calls.Why not just add this as an attribute?
it should only appear as a span attribute, not propagate to logs and metrics. This keeps AI conversation context isolated to spans where it's semantically relevant.