From 3b759c78063dc187ae69211f395bf5627846f2d5 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Wed, 24 Dec 2025 21:05:10 +0000 Subject: [PATCH] fix: support models with fixed reasoning levels in Gemini thinkingConfig guard --- src/api/transform/reasoning.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/api/transform/reasoning.ts b/src/api/transform/reasoning.ts index 887810db00..eecb2483d1 100644 --- a/src/api/transform/reasoning.ts +++ b/src/api/transform/reasoning.ts @@ -133,8 +133,12 @@ export const getGeminiReasoning = ({ }: GetModelReasoningOptions): GeminiReasoningParams | undefined => { // Only send thinkingConfig to models that advertise support for it; Gemini 3 rejects // the field and returns 400 otherwise. + // This checks for: budget support, effort UI support, or fixed reasoning level defaults. const supportsThinkingConfig = - typeof model.maxThinkingTokens === "number" || model.supportsReasoningBudget || model.supportsReasoningEffort + typeof model.maxThinkingTokens === "number" || + model.supportsReasoningBudget || + model.supportsReasoningEffort || + !!model.reasoningEffort // Budget-based (2.5) models: use thinkingBudget, not thinkingLevel. if (shouldUseReasoningBudget({ model, settings })) {