From 1bbf6206d53b988f313b3d0dcfb6a5587b6b3301 Mon Sep 17 00:00:00 2001 From: Sean McLellan Date: Mon, 16 Feb 2026 15:15:12 -0500 Subject: [PATCH] fix: exclude google-antigravity from Gemini schema sanitization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit google-antigravity serves Anthropic models (e.g. claude-opus-4-6-thinking), not Gemini. sanitizeToolsForGoogle was stripping JSON Schema keywords (minimum, maximum, format, etc.) needed for Anthropic's draft 2020-12 compliance, causing "JSON schema is invalid" rejections on tool 21 (web_search). This was the actual root cause — the earlier normalizeToolParameters fix was being overridden by this second sanitization pass. Co-Authored-By: Claude Opus 4.6 --- src/agents/pi-embedded-runner/google.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/agents/pi-embedded-runner/google.ts b/src/agents/pi-embedded-runner/google.ts index 868db5983ed..fb7b968e765 100644 --- a/src/agents/pi-embedded-runner/google.ts +++ b/src/agents/pi-embedded-runner/google.ts @@ -245,7 +245,11 @@ export function sanitizeToolsForGoogle< tools: AgentTool[]; provider: string; }): AgentTool[] { - if (params.provider !== "google-antigravity" && params.provider !== "google-gemini-cli") { + // google-antigravity serves Anthropic models (e.g. claude-opus-4-6-thinking), + // NOT Gemini. Applying Gemini schema cleaning strips JSON Schema keywords + // (minimum, maximum, format, etc.) that Anthropic's API requires for + // draft 2020-12 compliance. Only clean for actual Gemini providers. + if (params.provider !== "google-gemini-cli") { return params.tools; } return params.tools.map((tool) => {