feat(attributes): add gen ai data migrations#455
Conversation
Add migrations that normalize deprecated gen_ai request and response attributes into the newer input and output message attributes. The migrations preserve existing replacement values, remove normalized source attributes, and include coverage across JavaScript, Python, and Rust.
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Attributes
Docs
Bug Fixes 🐛
Documentation 📚
Internal Changes 🔧Deps
Other
Other
🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 5c3da4b. Configure here.
| return JSON.stringify([{ role: 'assistant', parts }]); | ||
| } | ||
|
|
||
| return textValue ?? toolCallsValue; |
There was a problem hiding this comment.
Empty tool calls skip wrapper
Medium Severity
The gen_ai_response_to_output_messages migration only builds gen_ai.output.messages when parts is non-empty. If gen_ai.response.tool_calls is a valid JSON empty array (or text extracts to no parts), it returns the raw source value such as [] instead of the usual [{"role":"assistant","parts":...}] envelope used for all other migrated tool-call and text inputs.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 5c3da4b. Configure here.


Summary
gen_ai.request.messages→gen_ai.input.messagesdata migrationgen_ai.response.text/gen_ai.response.tool_calls→gen_ai.output.messagesdata migrationStacked on #454.
Contributes to TET-2369.
Testing
yarn test