From 3aa6d0503dbcba08666cb6ace45dcef2b9144a67 Mon Sep 17 00:00:00 2001 From: spiceoogway Date: Fri, 30 Jan 2026 08:37:23 -0500 Subject: [PATCH] fix: Remove standard Google providers from reasoning tag enforcement (#4536) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #4536 - WebChat shows empty Assistant responses Root cause: Standard Google providers (google-gemini-cli, google-generative-ai) were incorrectly classified as 'reasoning tag providers', which: 1. Added instructions to use and tags in system prompt 2. Enabled enforceFinalTag=true which requires ALL responses to have tags 3. Stripped responses to empty strings when no tag found Gemini 2.0 doesn't natively use these tags, so all responses were stripped empty. Changes: - Remove 'google-gemini-cli' from isReasoningTagProvider() - Remove 'google-generative-ai' from isReasoningTagProvider() - Keep 'google-antigravity' (Gemini 3.0 DOES use reasoning tags) - Add clarifying comments about which providers natively use tags Impact: - ✅ Gemini 2.0 responses now display correctly - ✅ OpenAI errors now shown to users - ✅ Google Antigravity (Gemini 3.0) still works correctly - ✅ Ollama and Minimax unchanged --- src/utils/provider-utils.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/utils/provider-utils.ts b/src/utils/provider-utils.ts index e29ffe1ab..25d468a7a 100644 --- a/src/utils/provider-utils.ts +++ b/src/utils/provider-utils.ts @@ -6,21 +6,22 @@ * Returns true if the provider requires reasoning to be wrapped in tags * (e.g. and ) in the text stream, rather than using native * API fields for reasoning/thinking. + * + * NOTE: Only include providers that NATIVELY use and tags. + * Standard Gemini 2.0 (google-gemini-cli, google-generative-ai) does NOT use + * these tags natively, but Google Antigravity (Gemini 3.0) does. */ export function isReasoningTagProvider(provider: string | undefined | null): boolean { if (!provider) return false; const normalized = provider.trim().toLowerCase(); // Check for exact matches or known prefixes/substrings for reasoning providers - if ( - normalized === "ollama" || - normalized === "google-gemini-cli" || - normalized === "google-generative-ai" - ) { + if (normalized === "ollama") { return true; } // Handle google-antigravity and its model variations (e.g. google-antigravity/gemini-3) + // This is Gemini 3.0 which DOES use reasoning tags natively. if (normalized.includes("google-antigravity")) { return true; }