Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions src/core/task/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
}
Expand Down Expand Up @@ -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)
}
}
}
}
Expand Down
Loading