Skip to content

Commit 7decf9d

Browse files
committed
fix: update test descriptions to be buffer-agnostic
1 parent 840fbec commit 7decf9d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/browser/utils/compaction/autoCompactionCheck.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ describe("checkAutoCompaction", () => {
319319
expect(result.shouldForceCompact).toBe(false);
320320
});
321321

322-
test("shouldForceCompact is true when remaining <= 4k buffer", () => {
323-
// 200k - 196k = 4k remaining (exactly at buffer)
322+
test("shouldForceCompact is true when remaining <= buffer", () => {
323+
// Exactly at buffer threshold
324324
const liveUsage = createUsageEntry(SONNET_MAX_TOKENS - BUFFER);
325325
const usage = createMockUsage(50_000, undefined, KNOWN_MODELS.SONNET.id, liveUsage);
326326
const result = checkAutoCompaction(usage, KNOWN_MODELS.SONNET.id, false, true);
@@ -336,8 +336,8 @@ describe("checkAutoCompaction", () => {
336336
expect(result.shouldForceCompact).toBe(true);
337337
});
338338

339-
test("shouldForceCompact is false when just above 4k buffer", () => {
340-
// 200k - 195999 = 4001 remaining (just above buffer)
339+
test("shouldForceCompact is false when just above buffer", () => {
340+
// 1 token above buffer threshold
341341
const liveUsage = createUsageEntry(SONNET_MAX_TOKENS - BUFFER - 1);
342342
const usage = createMockUsage(50_000, undefined, KNOWN_MODELS.SONNET.id, liveUsage);
343343
const result = checkAutoCompaction(usage, KNOWN_MODELS.SONNET.id, false, true);
@@ -346,7 +346,7 @@ describe("checkAutoCompaction", () => {
346346
});
347347

348348
test("shouldForceCompact respects 1M context mode", () => {
349-
// With 1M context, 996k tokens = 4k remaining (should trigger)
349+
// With 1M context, exactly at buffer threshold
350350
const liveUsage = createUsageEntry(1_000_000 - BUFFER);
351351
const usage = createMockUsage(50_000, undefined, KNOWN_MODELS.SONNET.id, liveUsage);
352352
const result = checkAutoCompaction(usage, KNOWN_MODELS.SONNET.id, true, true);

0 commit comments

Comments
 (0)