-
Notifications
You must be signed in to change notification settings - Fork 95
TRT-2393: fix(chat): prevent LLM from modifying test_details URL parameters #3086
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
TRT-2393: fix(chat): prevent LLM from modifying test_details URL parameters #3086
Conversation
Rename 'query_params' parameter to 'url' in get_test_details_report tool and add explicit instruction to pass URLs verbatim without modification. This prevents the LLM from incorrectly reformatting query parameters like 'dbGroupBy=LayeredProduct'. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Pipeline controller notification For optional jobs, comment |
|
@stbenjam: This pull request references TRT-2393 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
WalkthroughThe Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches❌ Failed checks (2 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
@stbenjam: This pull request references TRT-2393 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
chat/sippy_agent/tools/sippy_test_details.py (1)
63-76: Consider validating query parameters are non-empty.The URL parsing logic correctly handles full URLs, paths, and plain query params. However, an empty or whitespace-only input would be treated as valid query params, potentially creating a malformed API URL.
Consider adding validation after extracting query params:
else: # It's just query params query_params = url_input + + if not query_params: + return {"error": "No query parameters provided"} # Ensure query params don't start with ? or &Alternatively, you could make the URL detection more explicit:
- if url_input.startswith('http') or url_input.startswith(':/'): + if '://' in url_input or url_input.startswith('/'):This would more precisely detect full URLs (containing
://) versus paths.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
chat/sippy_agent/tools/sippy_test_details.py(3 hunks)
🔇 Additional comments (3)
chat/sippy_agent/tools/sippy_test_details.py (3)
21-34: LGTM! Clear instructions to prevent LLM modification.The updated description with "passed verbatim without modification" directly addresses the PR objective of preventing the LLM from reformatting query parameters.
39-40: LGTM! Field rename improves clarity.Renaming from
query_paramstourlmakes the parameter more semantically clear for the LLM, and the explicit "without any modifications" instruction reinforces the PR objective.
72-72: LGTM! Error message correctly references the new variable.
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: smg247, stbenjam The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Scheduling required tests: |
|
@stbenjam: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Rename 'query_params' parameter to 'url' in get_test_details_report tool and add explicit instruction to pass URLs verbatim without modification. This prevents the LLM from incorrectly reformatting query parameters like 'dbGroupBy=LayeredProduct'.
Summary by CodeRabbit
Release Notes