mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-08 03:07:53 +00:00
fix: disable reasoning for Gemini/Vertex during context condensing
- Prevents API errors when using Gemini Flash with reasoning enabled - Reasoning blocks interfere with condensing prompt structure - Fixes issue #9867
This commit is contained in:
parent
1f7e1ee630
commit
927f0e52b6
1 changed files with 22 additions and 2 deletions
|
|
@ -1314,7 +1314,17 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
|
|||
})
|
||||
// Ensure profile and apiProvider exist before trying to build handler
|
||||
if (profile && profile.apiProvider) {
|
||||
condensingApiHandler = buildApiHandler(profile)
|
||||
// For Gemini providers, disable reasoning features during condensing to prevent API errors
|
||||
// Reasoning blocks can interfere with the condensing prompt structure
|
||||
if (profile.apiProvider === "gemini" || profile.apiProvider === "vertex") {
|
||||
condensingApiHandler = buildApiHandler({
|
||||
...profile,
|
||||
enableReasoningEffort: false,
|
||||
modelMaxThinkingTokens: undefined,
|
||||
})
|
||||
} else {
|
||||
condensingApiHandler = buildApiHandler(profile)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3460,7 +3470,17 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
|
|||
|
||||
// Ensure profile and apiProvider exist before trying to build handler.
|
||||
if (profile && profile.apiProvider) {
|
||||
condensingApiHandler = buildApiHandler(profile)
|
||||
// For Gemini providers, disable reasoning features during condensing to prevent API errors
|
||||
// Reasoning blocks can interfere with the condensing prompt structure
|
||||
if (profile.apiProvider === "gemini" || profile.apiProvider === "vertex") {
|
||||
condensingApiHandler = buildApiHandler({
|
||||
...profile,
|
||||
enableReasoningEffort: false,
|
||||
modelMaxThinkingTokens: undefined,
|
||||
})
|
||||
} else {
|
||||
condensingApiHandler = buildApiHandler(profile)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue