From 031d687325cd5166e363c6c668ac6620b5366642 Mon Sep 17 00:00:00 2001 From: can1357 Date: Fri, 24 Jul 2026 03:07:17 +0200 Subject: [PATCH] test(coding-agent): aligned transcript compaction test with superseded-summary elision - Superseded compaction summaries render as elided placeholders in the forward transcript since cb63ebd; only the active compaction keeps its text and frames. --- packages/coding-agent/test/compaction.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/coding-agent/test/compaction.test.ts b/packages/coding-agent/test/compaction.test.ts index b7fe41d8d..a3e8ed43e 100644 --- a/packages/coding-agent/test/compaction.test.ts +++ b/packages/coding-agent/test/compaction.test.ts @@ -1239,7 +1239,9 @@ describe("buildSessionContext", () => { const entries: SessionEntry[] = [u1, a1, compact1, u2, compact2, u3]; const transcript = buildSessionContext(entries, undefined, undefined, { transcript: true }); - // Nothing erased: every message survives, compactions sit where they fired. + // Nothing dropped positionally: every message survives, compactions sit + // where they fired. Superseded compaction summaries are elided in the + // forward transcript; only the active (latest) compaction keeps its text. expect(transcript.messages.map(m => m.role)).toEqual([ "user", "assistant", @@ -1250,7 +1252,8 @@ describe("buildSessionContext", () => { ]); const first = transcript.messages[2] as { summary: string }; const second = transcript.messages[4] as { summary: string; images?: unknown }; - expect(first.summary).toContain("First summary"); + expect(first.summary).toContain("Superseded compaction summary elided"); + expect(first.summary).not.toContain("First summary"); expect(second.summary).toContain("Second summary"); // Snapcompact frames ride along in the transcript too. expect(second.images).toEqual([{ type: "image", data: "ZmFrZQ==", mimeType: "image/png" }]);