Skip to content

Commit d18b3c9

Browse files
committed
feat: modelMaxContextWindow for context condensing
1 parent e610717 commit d18b3c9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core/task/Task.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,10 @@ export class Task extends EventEmitter<ClineEvents> {
16231623
? this.apiConfiguration.modelMaxTokens || DEFAULT_THINKING_MODEL_MAX_TOKENS
16241624
: modelInfo.maxTokens
16251625

1626-
const contextWindow = modelInfo.contextWindow
1626+
const contextWindow =
1627+
this.apiConfiguration.apiProvider === "gemini" && this.apiConfiguration.modelMaxContextWindow
1628+
? this.apiConfiguration.modelMaxContextWindow
1629+
: modelInfo.contextWindow
16271630

16281631
const truncateResult = await truncateConversationIfNeeded({
16291632
messages: this.apiConversationHistory,

0 commit comments

Comments
 (0)