Repository navigation
fix(gemini): honor default tool choice - #3858
Merged
Merged
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
jujn
approved these changes
Oct 30, 2026
chickenlj
pushed a commit
that referenced
this pull request
Nov 13, 2026
Apply effective per-call and builder-default tool choice through the existing 2.0.x Gemini request path without changing explicit model names. (cherry picked from commit 4c35877) Constraint: No AgentScope Service or SDK migration Confidence: high Not-tested: Whole-repository verification pending after lane integration
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.
AgentScope-Java Version
2.1.0-SNAPSHOT
Description
Summary
Gemini ignored
toolChoicein model defaults, although the equivalent per-call setting populated the provider request. Resolve the effective choice with the existingGenerateOptions.mergeOptionscontract before applying the existing Gemini formatter.Explicit per-call values retain priority. Add five request-config regression tests and matching EN/ZH documentation for default and per-call precedence.
Refs #3834 (slice 06). The shared tracking issue remains open for the other slices.
Evidence
GeminiChatModelTestagainst the original implementation produces 3 errors: default Specific, default Specific with an unrelated per-call option, and default Specific with server tools all lack the expected function-calling configuration. The other 40 tests pass.spotless:checkpasses.mvn -T1C -pl agentscope-extensions/agentscope-extensions-model/agentscope-extensions-model-gemini -am test spotless:check.mint validateis blocked locally by anEPERMwhile cleaning its shared preview directory. No live Gemini requests or full-repositoryclean verifywere run.Merge Danger
Door: two-way; reverting the commit restores the previous behavior.
Blast Radius: Gemini. Calls with function tools now honor a configured default tool choice; explicit per-call overrides remain effective.
Checklist
mvn spotless:checkmvn -T1C -pl ... -am test)