diff --git a/.changeset/cold-poems-change.md b/.changeset/cold-poems-change.md new file mode 100644 index 00000000000..41693ccdfc7 --- /dev/null +++ b/.changeset/cold-poems-change.md @@ -0,0 +1,5 @@ +--- +"roo-cline": patch +--- + +v3.7.5 diff --git a/src/core/sliding-window/index.ts b/src/core/sliding-window/index.ts index 056358c1198..a0fff05ea55 100644 --- a/src/core/sliding-window/index.ts +++ b/src/core/sliding-window/index.ts @@ -49,5 +49,5 @@ export function truncateConversationIfNeeded( */ function getMaxTokens(modelInfo: ModelInfo): number { // The buffer needs to be at least as large as `modelInfo.maxTokens`, or 20% of the context window if for some reason it's not set. - return modelInfo.contextWindow - Math.max(modelInfo.maxTokens || modelInfo.contextWindow * 0.2) + return modelInfo.contextWindow - (modelInfo.maxTokens || modelInfo.contextWindow * 0.2) }