mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
fix: clarify Gemini thinkingConfig support guard to prevent 400 errors
This commit is contained in:
parent
1e71015e54
commit
e13dfb030c
1 changed files with 10 additions and 0 deletions
|
|
@ -131,6 +131,11 @@ export const getGeminiReasoning = ({
|
|||
reasoningEffort,
|
||||
settings,
|
||||
}: GetModelReasoningOptions): GeminiReasoningParams | undefined => {
|
||||
// Only send thinkingConfig to models that advertise support for it; Gemini 3 rejects
|
||||
// the field and returns 400 otherwise.
|
||||
const supportsThinkingConfig =
|
||||
typeof model.maxThinkingTokens === "number" || model.supportsReasoningBudget || model.supportsReasoningEffort
|
||||
|
||||
// Budget-based (2.5) models: use thinkingBudget, not thinkingLevel.
|
||||
if (shouldUseReasoningBudget({ model, settings })) {
|
||||
return { thinkingBudget: reasoningBudget!, includeThoughts: true }
|
||||
|
|
@ -150,6 +155,11 @@ export const getGeminiReasoning = ({
|
|||
return undefined
|
||||
}
|
||||
|
||||
// Skip thinking config for models that don't advertise support (e.g., Gemini 3).
|
||||
if (!supportsThinkingConfig) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
// Effort-based models on Google GenAI support minimal/low/medium/high levels.
|
||||
if (!isGeminiThinkingLevel(selectedEffort)) {
|
||||
return undefined
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue