Skip to content
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

🤖 Implement Tool Message Validation in Client Logic #1456

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sentry-autofix[bot]
Copy link
Contributor

👋 Hi there! This PR was automatically generated by Autofix 🤖

This fix was triggered by Jenn Mueng

Fixes SEER-EC

This pull request introduces a new validation mechanism for tool messages in the LlmClient. It includes a method validate_tool_message_sequence that ensures that tool result messages have corresponding tool use messages, effectively converting invalid tool messages into regular user messages when no valid tool use ID is found. This validation is integrated into the message processing pipeline before sending requests to the external service. Additionally, unit tests are added to verify that both the validation function and the handling of invalid tool sequences within the Anthropic provider do not raise errors, enhancing the robustness and reliability of the messaging system.

If you have any questions or feedback for the Sentry team about this fix, please email [email protected] with the Run ID: 1466.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants