#17841: fix(google): include 'google' provider in tool schema sanitization
agents
size: XS
experienced-contributor
Cluster:
Tool Schema Fixes and Enhancements
## Summary
Fixes #17826
## Problem
`sanitizeToolsForGoogle()` and `logToolSchemasForGoogle()` only checked for `google-antigravity` and `google-gemini-cli` providers, missing the plain `google` provider.
This caused tools sent to Gemini via the standard Google AI API key to have broken schemas with duplicate parameter names (`path`/`file_path`, `oldText`/`old_string`, `newText`/`new_string`), confusing the model and causing parameter loops.
## Changes
- Added `google` to the provider check in `sanitizeToolsForGoogle()`
- Added `google` to the provider check in `logToolSchemasForGoogle()`
---
🤖 Generated with Claude Code
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds the plain `"google"` provider to the provider check in both `sanitizeToolsForGoogle()` and `logToolSchemasForGoogle()`. Previously, only `"google-antigravity"` and `"google-gemini-cli"` were handled, which meant users authenticating via a standard Google AI API key (provider `"google"`) would send unsanitized tool schemas to Gemini — causing duplicate parameter names and model confusion.
- Added `"google"` to the early-return guard in `sanitizeToolsForGoogle()` so tool schemas are cleaned for the plain Google provider
- Added `"google"` to the early-return guard in `logToolSchemasForGoogle()` so diagnostic logging also fires for the plain Google provider
- The existing test (`google.e2e.test.ts`) only covers `provider: "google-gemini-cli"` — a test case for `provider: "google"` would help prevent regression
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge — it's a minimal, well-scoped bug fix that adds a missing provider string to two guard clauses.
- The change is a two-line addition (same string added to two parallel guard clauses) that fixes a clear omission. The `"google"` provider is well-established throughout the codebase, and the fix is consistent with how the other two Google providers are already handled. No new logic is introduced, and the risk of regression is negligible.
- No files require special attention.
<sub>Last reviewed commit: df69fc1</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#22321: fix: sanitize tool schemas for all Cloud Code Assist providers
by Sr-0w · 2026-02-21
87.9%
#22214: fix(tools): sanitize google-antigravity schemas for Gemini-compatib...
by Kansodata · 2026-02-20
87.7%
#21835: fix: apply schema cleaning for google-antigravity in normalizeToolP...
by ephraimm · 2026-02-20
85.4%
#13976: fix(anthropic): include Anthropic in tool call ID sanitization
by omair445 · 2026-02-11
78.1%
#12608: fix: sanitize client tool call IDs per provider requirements
by piyushhhxyz · 2026-02-09
77.6%
#13075: [Feature]: Add Gemini (Google Search grounding) as web_search provider
by akoscz · 2026-02-10
77.4%
#5011: fix(gemini): strip JSON thoughtSignature from tool calls for Gemini 3+
by shayan919293 · 2026-01-30
76.8%
#21263: fix: add google-vertex support for Gemini 3.1 models
by pdd-cli · 2026-02-19
76.7%
#13006: fix(provider): disable reasoning tags for gemini-3-pro variants to ...
by whyuds · 2026-02-10
76.5%
#15205: fix(models): normalize google-antigravity api field from google-gem...
by wboudy · 2026-02-13
75.6%