Skip to content

fix(gemini): keep generated function call IDs distinct - #3982

Merged
jujn merged 2 commits into
agentscope-ai:mainfrom
yyytttwww888-beep:fix/gemini-tool-call-ids
Nov 6, 2026
Merged

jujn merged 2 commits into
agentscope-ai:mainfrom
yyytttwww888-beep:fix/gemini-tool-call-ids

Conversation

@yyytttwww888-beep

@yyytttwww888-beep yyytttwww888-beep commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

AgentScope-Java Version

2.1.0-SNAPSHOT, based on main f9d717e.

Description

Fixes #3980.

When Gemini returns multiple local function calls without IDs in one millisecond, the parser gives them identical IDs. The accumulator merges their arguments and the Agent rejects the resulting malformed call, so a request for Tokyo and Paris weather can execute neither lookup.

Generate fallback IDs with UUIDs and retain provider-supplied IDs. The regression tests pass real Gemini response objects through the parser and accumulator across parts/chunks, and verify that a real ReActAgent executes both calls to the same tool. Both paths include controls with explicit provider IDs. The English and Chinese Gemini guides describe the behavior.

Validation:

  • On unchanged main, the aggregation regression retained 5 of 64 calls and the Agent regression executed zero of the requested two calls; the provider-ID controls passed.
  • mvn -B -ntp -T1C -pl agentscope-extensions/agentscope-extensions-model/agentscope-extensions-model-gemini -am spotless:apply test -Dtest=GeminiToolCallIdentityTest,GeminiResponseParserTest passed: 25 tests, no failures or skips.
  • Full repository mvn -B -ntp -T1C clean verify passed: 11,993 tests reported, 0 failures/errors, 248 skipped. Provider credentials were excluded from the test environment.
  • Documentation npm test (13 tests), npm run validate and npm run broken-links passed with Node.js 22.

Checklist

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated
  • Code is ready for review

@yyytttwww888-beep
yyytttwww888-beep marked this pull request as ready for review November 5, 2026 01:47
@jujn
jujn merged commit a732224 into agentscope-ai:main Nov 6, 2026
5 checks passed
chickenlj pushed a commit that referenced this pull request Nov 13, 2026
Backport the verified fix to the 2.0.x implementation and retain its
existing public contracts where the upstream kernel differs.

(cherry picked from commit a732224)
Constraint: No AgentScope Service or SDK migration
Confidence: high
Not-tested: Whole-repository verification pending after lane integration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Gemini function calls without IDs can merge and skip tool execution

2 participants