fix(cli): skip thinkingLevel for Gemma models on Google provider

Gemma 4 models (gemma-4-31b-it, gemma-4-26b-a4b-it) don't support the
thinkingLevel parameter. When models.dev metadata reports reasoning
capability for these models, the variants function generates
thinkingConfig with thinkingLevel entries that cause 400
INVALID_ARGUMENT errors from the Google AI Studio API.

Add an early return for gemma model IDs before the thinkingLevel default
branch, matching the pattern used by grok (line 728) and other
non-reasoning models.

Closes #12063
This commit is contained in:
umi008
2026-07-12 22:17:04 -06:00
parent 3cb82a0907
commit 05dadaaaed
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@kilocode/cli": patch
---
Fix Gemma 4 models failing with "thinkingLevel not supported" when using Google AI Studio.
@@ -1014,6 +1014,7 @@ export function variants(model: Provider.Model): Record<string, Record<string, a
// https://v5.ai-sdk.dev/providers/ai-sdk-providers/google-vertex
case "@ai-sdk/google":
// https://v5.ai-sdk.dev/providers/ai-sdk-providers/google-generative-ai
if (id.includes("gemma")) return {} // kilocode_change
if (id.includes("2.5")) {
return {
high: {