Make compression algo slightly more aggressive (#10024)

This commit is contained in:
Tommaso Sciortino
2025-09-27 05:15:53 -07:00
committed by GitHub
parent e43d6e2a17
commit 003ca98f84
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -83,7 +83,6 @@ export function findCompressSplitPoint(
let lastSplitPoint = 0; // 0 is always valid (compress nothing)
let cumulativeCharCount = 0;
for (let i = 0; i < contents.length; i++) {
cumulativeCharCount += charCounts[i];
const content = contents[i];
if (
content.role === 'user' &&
@@ -94,6 +93,7 @@ export function findCompressSplitPoint(
}
lastSplitPoint = i;
}
cumulativeCharCount += charCounts[i];
}
// We found no split points after targetCharCount.