Repository navigation
LangGraph runtime: give an agent the File Search stores assigned to it - #362
Merged
Merged
Conversation
The dashboard's File Search dialog assigns stores in agent_file_search_stores. AgentManager adds them to the agent's tool_config when it builds the agent on ADK; the LangGraph runtime built the tools from tool_config alone, so there an agent with stores assigned had no query_file_search tool. Both now go through add_assigned_stores() in file_search_tools.py: the stores assigned to the agent become its file_search entry, and with none assigned, or the database unreadable, tool_config is left as it was.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while re-checking the File Search guide in #361.
The bug
The dashboard's File Search dialog stores an agent's stores in
agent_file_search_stores.AgentManageradds them to the agent'stool_configwhen it builds the agent.AGENT_FRAMEWORK=langgraph), the tools were built fromtool_configalone. An agent with stores assigned in the dashboard therefore had noquery_file_searchtool there.The fix
Both runtimes now call
add_assigned_stores()inshared/utils/tools/file_search_tools.py:file_searchentry; othertool_configkeys are kept, and the input is not changed in place.tool_configis returned unchanged. If the database can't be read, the error is logged as a warning andtool_configis also returned unchanged. Both cases match ADK's behaviour before.agent_manager.pynow uses the helper instead of its own inline copy.Tests
New file
shared/test/test_file_search_assigned_stores.py, with 6 tests on a real temporary database:tool_configas it was with no stores or with a database error;query_file_search;Mutation check: with the LangGraph call removed, the LangGraph test fails.
The dev database has no assigned stores, and a store needs a real Google project, so this was not run against a live store.
Full suite: 2039 tests, 1 skipped.
Docs
docs/user/file-search.mdnow says both runtimes do this. Docs: re-check the eight migrated user guides against the code (#205) #361 had documented the gap.docs/dev/langgraph-runtime.mdlists File Search under "Supported in v1".driftalso listsfallback-modelandagent-runtime. They don't describe File Search, so they still hold.