Skip to content

fix(ai): preserve unique Gemini function call IDs - #44051

Merged
rekram1-node merged 2 commits into
v2from
gemini-call-ids
Aug 22, 2026
Merged

rekram1-node merged 2 commits into
v2from
gemini-call-ids

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Closes #43940

Extracts the Gemini-specific fix from #43961 without the separate Core shell/Job ID change.

  • Preserve part.functionCall.id when Gemini provides one.
  • Generate globally unique fallback IDs when Gemini omits one.
  • Remove the request-local tool_0, tool_1, ... counter.
  • Cover provider IDs, fallback uniqueness within one response, uniqueness across requests, and continuation matching.

Original implementation and commit authored by @major in #43961. The provider-agnostic shell Job ID decoupling can be reviewed separately.

Verification:

  • cd packages/ai && bun test test/provider/gemini.test.ts --timeout 30000 --only-failures
  • cd packages/ai && bun typecheck

major and others added 2 commits August 21, 2026 22:46
- use part.functionCall.id when provided by Gemini models

- generate unique identifier fallbacks when tool call IDs are omitted

- remove per-request counter state that caused duplicate tool_0 IDs

Signed-off-by: Major Hayden <[email protected]>
@rekram1-node
rekram1-node merged commit a1d0f43 into v2 Aug 22, 2026
7 checks passed
@rekram1-node
rekram1-node deleted the gemini-call-ids branch August 22, 2026 04:12
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
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.

2 participants