-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix(federated-slack): pass in valid query #5402
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
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Greptile Summary
This PR fixes query handling issues in the federated Slack functionality by ensuring the original_query
parameter is properly passed through the search pipeline. The changes address two related problems:
-
SearchTool initialization fix: In
search_tool.py
, theoriginal_query
variable was previously initialized toNone
and could remain null whenoverride_kwargs
was not provided or whenoverride_kwargs.original_query
was null. The fix ensuresoriginal_query
always defaults to the inputquery
parameter, preventing downstream functions from receiving unexpected null values. -
DR Agent query parameter fix: In
dr_basic_search_2_act.py
, theSearchToolOverrideKwargs
was missing theoriginal_query
parameter entirely. The fix addsoriginal_query=rewritten_query
to ensure the search system has proper query tracking even when queries are rewritten by the LLM.
These changes work together to maintain query continuity through the search pipeline. The SearchTool expects an original_query
string for proper search request construction (line 411 in search_tool.py
), and the DR agent now provides this required parameter. This is particularly important for federated search scenarios where maintaining original query context is crucial for proper attribution, analytics, and search functionality. The fixes use defensive programming patterns (or query
fallback) to ensure backward compatibility while preventing null reference errors.
Confidence score: 5/5
- This PR is safe to merge with minimal risk as it fixes clear null reference issues
- Score reflects straightforward defensive programming fixes that address specific bug scenarios without changing core logic
- No files require special attention - both changes are simple parameter handling improvements
2 files reviewed, no comments
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.
1 issue found across 2 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="backend/onyx/agents/agent_search/dr/sub_agents/basic_search/dr_basic_search_2_act.py">
<violation number="1" location="backend/onyx/agents/agent_search/dr/sub_agents/basic_search/dr_basic_search_2_act.py:155">
Passing rewritten_query as original_query loses the user's raw phrasing used by federated Slack expansions and is redundant since SearchTool defaults original_query to query anyway; use the raw user query instead for correct behavior.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai
to give feedback, ask questions, or re-run the review.
Description
[Provide a brief description of the changes in this PR]
How Has This Been Tested?
[Describe the tests you ran to verify your changes]
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.
Summary by cubic
Fixes federated Slack search by always sending a valid original_query to the search tool. Defaults to the user query and uses the rewritten query when available to prevent None/empty values.