Skip to content

fix(google): set includeServerSideToolInvocations for mixed tools#285

Merged
Kamilbenkirane merged 2 commits into
mainfrom
fix/gemini-mixed-tools
Jun 12, 2026
Merged

fix(google): set includeServerSideToolInvocations for mixed tools#285
Kamilbenkirane merged 2 commits into
mainfrom
fix/gemini-mixed-tools

Conversation

@Kamilbenkirane

Copy link
Copy Markdown
Member

Summary

  • Sets toolConfig.includeServerSideToolInvocations when Gemini requests combine built-in tools (e.g. WebSearch, CodeExecution, raw provider dicts) with user functionDeclarations, fixing AI Studio 400 errors.
  • Tracks server-side tools in a single pass inside ToolsMapper.map() instead of re-scanning the tool list.
  • Adds parametrized unit tests in test_google_tools_mapper.py for mixed and non-mixed tool combinations.

Test plan

  • uv run pytest tests/unit_tests/test_google_tools_mapper.py tests/unit_tests/test_tool_choice.py -q
  • Pre-push hook: full unit test suite with coverage
  • Chat runtime: uv run pytest tests/test_chat_runtime.py -q (editable install)

Made with Cursor

Kamilbenkirane and others added 2 commits June 12, 2026 17:42
Gemini AI Studio rejects requests that combine built-in tools with
functionDeclarations unless toolConfig.includeServerSideToolInvocations
is true. Track server-side tools in a single pass and add mapper tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Kamilbenkirane Kamilbenkirane merged commit cb945c5 into main Jun 12, 2026
11 checks passed
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.

1 participant