fix: disable native tools for Gemini models in OpenAI compatible provider #9387
+8
−1
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.
Description
This PR fixes an issue where Gemini models accessed via OpenAI Compatible provider were incorrectly attempting to use native OpenAI tool calling format, which they don't support. The fix detects Gemini models by their model ID and disables native tool support, forcing them to use XML-style tool calls instead.
Problem
Starting with v3.33.1, when native tool calling support was added to the OpenAI-compatible provider, Gemini models stopped working correctly. They would output valid XML tool calls, but these would not be recognized or executed because the system was expecting native format instead.
Solution
The fix checks if the model ID contains 'gemini' (case-insensitive) and overrides the flag to , ensuring these models use the XML protocol for tool calls.
Testing
RUN v3.2.4 /data/repos/Roo-Code
Test Files 1 failed (1)
Tests no tests
Start at 08:10:47
Duration 1.51s (transform 665ms, setup 0ms, collect 0ms, tests 0ms, environment 0ms, prepare 113ms)
Fixes #9385