-
Notifications
You must be signed in to change notification settings - Fork 578
fix(ai): Keep single content input message #5345
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
base: master
Are you sure you want to change the base?
Conversation
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Bug Fixes 🐛
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
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.
| scope._gen_ai_original_message_count[span.span_id] = len(messages) | ||
|
|
||
| return truncated_messages | ||
| return [truncated_message] |
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.
Embeddings input loses all but the last text
Medium Severity
The truncate_and_annotate_messages function is now used for embeddings input in LiteLLM and OpenAI integrations. With the new behavior that always returns only the last item, embeddings with multiple texts (e.g., ["First text", "Second text", "Third text"]) will only capture the last text (["Third text"]). This is data loss - when embedding multiple texts, users expect to see all texts that were embedded, not just the last one. The PR title mentions "message" but embeddings are fundamentally different from chat messages.
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.
will need to address this
This reverts commit 01d0619.
Description
Store only one message from the conversation history on the
gen_ai.request.messagesattribute.Remove prior logic that progressively trims away messages. Removes tests that check the existence of conversation histories or prompt messages that are no longer set on the attribute.
Issues
Closes #5335
Reminders
tox -e linters.feat:,fix:,ref:,meta:)