[Fix] Gemini requests fail when user enables the full MCP tool set#148
[Fix] Gemini requests fail when user enables the full MCP tool set#148roomote[bot] wants to merge 8 commits into
Conversation
|
No new code issues found.
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
0ab7b1f to
2edf5d8
Compare
|
Addressed the new PR feedback on the existing branch and refreshed the PR metadata. See task Shipped commit: 22d0bf9 What changed:
Validation:
Browser proof: not applicable for this non-visual provider/schema fix. The recursive-schema review thread is resolved. GitHub now shows review required again because this new commit replaced the previously approved head. |
edelauna
left a comment
There was a problem hiding this comment.
Fix for an issue I was getting with Gemini and some mcp usage.
71776f8 to
63a6f25
Compare
3c8eb15 to
121762c
Compare
edelauna
left a comment
There was a problem hiding this comment.
Updating e2e tests and fixing an issue with MCP tool calling and gemini.
121762c to
aff8241
Compare
Related GitHub Issue
Closes: N/A - Roomote task linked above.
References: RooCodeInc/Roo-Code#12202
Description
Fixes Gemini
400 INVALID_ARGUMENTfailures that occurred when the provider sent the full MCP/native tool set.Key changes:
allowedFunctionNameslists to Gemini after live API testing showed genericINVALID_ARGUMENTfailures with larger restriction lists and history-incompatible function names.$refresolution,allOfmerging, and recursion guards for self-referential schemas.parametersJsonSchema, absence of broadallowedFunctionNames, reasoning config, recursive schema handling, and e2e record/replay behavior.Reviewers should pay closest attention to the provider trade-off: Gemini no longer receives broad provider-side callable restrictions, so the execution layer remains the final guard for mode-disallowed tools.
Test Procedure
Manual verification:
pnpm run install:vsix:force -y --editor=code.400 INVALID_ARGUMENT.Automated checks:
Pre-Submission Checklist
Screenshots / Videos
N/A - no UI changes.
Documentation Updates
Additional Notes
Direct Gemini API testing found that function declaration count alone was not the failing condition: requests with more than 25 declarations could succeed when broad
allowedFunctionNameswas omitted. The failure reproduced whenallowedFunctionNamesgrew beyond the backend's effective tolerance or excluded names needed by prior tool-call history.Schema compatibility cleanup is intentionally conservative. Gemini documents function declaration schemas as an OpenAPI-style subset with single-value
typeplusnullable, while third-party MCP servers may emit broader JSON Schema constructs.Get in Touch
Elliott de Launay