-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix claude bug #4493
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
fix claude bug #4493
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
PR Summary
This PR fixes a bug where the task prompt was mistakenly incorporated into the user query for tool call arguments in the tool response handler.
- Modified
/backend/onyx/chat/tool_handling/tool_response_handler.py
to remove the erroneous re-assignment. - Ensures that
prompt_builder.raw_user_query
is used correctly in selecting tool call arguments.
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
user_query = prompt_builder.raw_user_query | ||
history = prompt_builder.raw_message_history | ||
if isinstance(prompt_builder, AnswerPromptBuilder): | ||
user_query = prompt_builder.get_user_message_content() |
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.
Could I get some context here, please? What's the point of deleting this line?
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.
get_user_message_content() adds the task prompt (a prompt piece specified during assistant/persona creation; the search assistant has one that we wrote) to the user query. This is Good during the final prompt to the LLM asking for an answer, but the function that gets tool call args for non-tool-calling LLMs expects only the raw user query to be passed in. This was actually a holdover from a previous approach to a fix in which having the task prompt attached to the user query was actually desired behavior, but a later different approach (adding system prompt to the history, actually) made that unnecessary and I forgot to remove this part 😭
* fix claude bug * fixed tests
* fix claude bug * fixed tests
* fix claude bug * fixed tests
Description
Fix issue where task prompt was included as part of the user query when selecting tool call args
How Has This Been Tested?
tested in UI, code tests coming
Backporting (check the box to trigger backport action)
Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.