fix: Allow -latest model aliases in GoogleSearchTool - #1208
Merged
copybara-service[bot] merged 1 commit intoJul 14, 2026
Conversation
Contributor
Author
|
@anFatum, Please have a look into it. |
hemasekhar-p
force-pushed
the
model-latest-issue-fix
branch
from
May 21, 2026 13:33
5d9180b to
24a64f0
Compare
hemasekhar-p
force-pushed
the
model-latest-issue-fix
branch
from
June 16, 2026 09:47
24a64f0 to
ede19a3
Compare
hemasekhar-p
force-pushed
the
model-latest-issue-fix
branch
from
June 23, 2026 15:51
ede19a3 to
f3c1b37
Compare
tilgalas
approved these changes
Jun 24, 2026
tilgalas
reviewed
Jun 24, 2026
tilgalas
approved these changes
Jun 24, 2026
tilgalas
left a comment
Contributor
There was a problem hiding this comment.
thanks for the PR - overall LGTM with one comment
hemasekhar-p
force-pushed
the
model-latest-issue-fix
branch
3 times, most recently
from
June 25, 2026 11:25
20fb9c5 to
8b6a1ee
Compare
hemasekhar-p
force-pushed
the
model-latest-issue-fix
branch
from
July 10, 2026 10:37
8b6a1ee to
e607d98
Compare
hemasekhar-p
force-pushed
the
model-latest-issue-fix
branch
from
July 10, 2026 12:04
e607d98 to
533bde8
Compare
hemasekhar-p
force-pushed
the
model-latest-issue-fix
branch
from
July 14, 2026 08:58
533bde8 to
9181ea6
Compare
tilgalas
approved these changes
Jul 14, 2026
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
1. Link to an existing issue (if applicable):
-latestmodel aliases (e.g., gemini-flash-latest) #12032. Or, if no issue exists, describe the change:
If applicable, please follow the issue templates to provide as much detail as
possible.
Problem:
The GoogleSearchTool checks model.startsWith("gemini-2") || model.startsWith("gemini-3"), which rejects all -latest model aliases (gemini-flash-latest, gemini-pro-latest, gemini-flash-lite-latest).
Solution:
Introduced the
isSupportedModelhelper method to allow model names ending with-latestin addition to existing models.Testing Plan
Added unit tests to ensure missing models return the expected
IllegalArgumentExceptionand that-latestaliases are correctly accepted.Unit Tests:
The following test cases were added to BaseToolTest:
processLlmRequestWithLatestAliasAddsToolToConfig: Verifies that models ending in -latest are accepted and configured correctly.processLlmRequestWithUnsupportedModelReturnsError: Verifies rejection of invalid model strings.processLlmRequest_WithNullModel_ReturnsError: Verifies that a null model input does not crash and throws an IllegalArgumentException as expected.Checklist