← Back to PRs

#17841: fix(google): include 'google' provider in tool schema sanitization

by zerone0x open 2026-02-16 07:04 View on GitHub →
agents size: XS experienced-contributor
## 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