Feat: Google Search Agent Tool#316
Open
AmaadMartin wants to merge 7 commits into
Open
Conversation
0166981 to
72d74e5
Compare
kalenkevich
reviewed
May 11, 2026
| const searchTool = toolUnion as unknown as GoogleSearchTool; | ||
| if (searchTool.bypassMultiToolsLimit) { | ||
| const {createGoogleSearchAgent, GoogleSearchAgentTool} = | ||
| await import('../tools/google_search_agent_tool.js'); |
Collaborator
There was a problem hiding this comment.
please do not use inline imports
Collaborator
Author
There was a problem hiding this comment.
removed the inline import
added 6 commits
May 12, 2026 09:28
- Implement GoogleSearchAgentTool to wrap search sub-agent. - Implement automatic wrapping of GoogleSearchTool in LlmAgent when used with other tools. - Add propagateGroundingMetadata support to AgentTool. - Add comprehensive unit tests with 100% coverage for new code.
…tadata propagation
1337815 to
50ac619
Compare
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.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
Problem: The built-in
GoogleSearchToolcannot be used together with other tools in the same agent due to model limitations in Gemini 1.x. Inadk-python, a workaround was implemented to automatically wrap theGoogleSearchToolin a specialized sub-agent (GoogleSearchAgentTool) when multiple tools are present, allowing it to function alongside others. This capability was missing inadk-js.Solution: Ported the
GoogleSearchAgentToolfeature fromadk-pythontoadk-js. This includes:GoogleSearchToolinGoogleSearchAgentToolwhenbypassMultiToolsLimitis true and multiple tools are present.Testing Plan
Please describe the tests that you ran to verify your changes. This is required for all PRs that are not small documentation or typo fixes.
Unit Tests:
I ran the specific test file
core/test/tools/google_search_agent_tool_test.tsand all 13 tests passed.Coverage for
core/src/tools/google_search_agent_tool.tsandcore/src/tools/google_search_tool.tsachieved 100%.Integration Tests (Serving as Manual E2E):
An integration test was created at
tests/integration/tools/google_search_agent_tool_test.tsto simulate the full flow of automatic wrapping and grounding metadata propagation using mocked responses. This test serves as the verification for the end-to-end behavior, as manual testing with live models was not performed.Checklist