From 9e2c097782e7154aa26e98b68885e165293efc08 Mon Sep 17 00:00:00 2001 From: wassname <1103714+wassname@users.noreply.github.com> Date: Fri, 10 Apr 2026 20:43:42 +0000 Subject: [PATCH] fix: remove duplicate test --- pruner.test.ts | 44 -------------------------------------------- 1 file changed, 44 deletions(-) diff --git a/pruner.test.ts b/pruner.test.ts index 3448269..0d4b196 100644 --- a/pruner.test.ts +++ b/pruner.test.ts @@ -754,50 +754,6 @@ function findOrphanedToolUse(result: any[]): string | null { console.log(" PASS: corrupted block skipped, all original messages preserved"); console.log("TEST 10 PASSED\n"); -}// -// Blocks from older sessions may have null/Infinity timestamps due to JSON -// round-trip corruption. These blocks should be skipped during compression -// application and should not block new compress operations. -// --------------------------------------------------------------------------- -{ - console.log("TEST 11: corrupted block with null/Infinity timestamps is skipped"); - - const messages: any[] = [ - { role: "user", content: [{ type: "text", text: "hello" }], timestamp: 1000 }, - { role: "assistant", content: [{ type: "text", text: "hi" }], timestamp: 2000 }, - { role: "user", content: [{ type: "text", text: "bye" }], timestamp: 3000 }, - ]; - - // Block with corrupted timestamps (null from JSON round-trip) - const state = makeState([ - { - id: 1, - topic: "ghost block", - summary: "This block has corrupted timestamps.", - startTimestamp: null as any, // null from JSON deserialization of Infinity - endTimestamp: null as any, - anchorTimestamp: null as any, - active: true, - summaryTokenEstimate: 5, - createdAt: Date.now(), - }, - ]); - - const result = applyPruning(messages, state, makeConfig()); - - console.log(" Result messages:"); - for (const m of result) { - const preview = Array.isArray(m.content) - ? m.content.map((b: any) => b.text ?? b.type ?? "?").join(" | ").slice(0, 60) - : String(m.content).slice(0, 60); - console.log(` role="${m.role}" ts=${m.timestamp} content="${preview}"`); - } - - // All 3 original messages should survive (ghost block was skipped) - assert.strictEqual(result.length, 3, `FAIL — expected 3 messages, got ${result.length}`); - console.log(" PASS: corrupted block skipped, all original messages preserved"); - - console.log("TEST 11 PASSED\n"); } console.log("All tests passed.");