fix: include tool call id for non-Claude, non-Gemini models - #357
Open
kenny000666 wants to merge 1 commit into
Open
fix: include tool call id for non-Claude, non-Gemini models#357kenny000666 wants to merge 1 commit into
kenny000666 wants to merge 1 commit into
Conversation
The functionCall.id and functionResponse.id fields are required by Google Cloud Code API for all models except Gemini. The previous isClaudeModel guard meant that only Claude models received the id field, which broke tool calls for non-Claude, non-Gemini model families (e.g. gpt-oss). Changed the guard from isClaudeModel to !isGeminiModel so that: - Claude models still get the id (unchanged) - Gemini models do NOT get the id (unchanged - uses thoughtSignature) - gpt-oss and any future model families get the id (fixes tool calls)
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.
Summary
functionCall.idandfunctionResponse.idmust be populated for all models when using Google Cloud Code API, except for Gemini models which usethoughtSignatureinstead. The currentisClaudeModelguard only sets these fields for Claude models, breaking tool calls for any other model family.Changes
Changed the guard from
isClaudeModelto!isGeminiModelinsrc/format/content-converter.js:tool_use → functionCall:isClaudeModel && block.id→!isGeminiModel && block.idtool_result → functionResponse:isClaudeModel && block.tool_use_id→!isGeminiModel && block.tool_use_idWhy this matters
With PR #354 adding the
gpt-ossmodel family, users will encounter tool call failures:This fix ensures any non-Gemini model family works correctly with tool calls, not just Claude.
Compatibility
id✅id✅ (unchanged)id✅ (uses thoughtSignature)id✅ (unchanged)id❌ (broken tool calls)id✅ (fixed)Related
gpt-oss-120b-mediumandgemini-3-flash