From ac4ad78a5fa05c14b11cb1262cbfecc488912a2d Mon Sep 17 00:00:00 2001 From: Dotta Date: Sat, 12 Sep 2026 17:46:28 -0500 Subject: [PATCH] test: require current task briefs in adapter resume prompts Update Claude ACP and Hermes assertions to require the brief exactly once on resumed calls. Co-Authored-By: Paperclip --- packages/adapters/claude-local/src/server/acp.test.ts | 6 +++--- packages/adapters/hermes/src/gateway/server/execute.test.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/adapters/claude-local/src/server/acp.test.ts b/packages/adapters/claude-local/src/server/acp.test.ts index a0441be380..129b24f3e9 100644 --- a/packages/adapters/claude-local/src/server/acp.test.ts +++ b/packages/adapters/claude-local/src/server/acp.test.ts @@ -1196,7 +1196,7 @@ describe("claude_local ACP lane", () => { }); }); - it("delivers the issue description exactly once per prompt and compacts non-assignment resume deltas", async () => { + it("delivers the current issue description exactly once on fresh and resumed prompts", async () => { const root = await makeTempRoot("paperclip-claude-acp-brief-"); const runtimes: FakeRuntime[] = []; const execute = createClaudeAcpExecutor({ @@ -1264,9 +1264,9 @@ describe("claude_local ACP lane", () => { })); expect(second.exitCode).toBe(0); const resumePrompt = runtimes[1]?.startInputs[0]?.text ?? ""; - expect(resumePrompt).not.toContain(description); + expect(resumePrompt.split(description)).toHaveLength(2); expect(resumePrompt).toContain("Paperclip task context:"); - expect(resumePrompt).toContain( + expect(resumePrompt).not.toContain( "- issue description: omitted from this resume delta; fetch the issue if you need the latest brief", ); }); diff --git a/packages/adapters/hermes/src/gateway/server/execute.test.ts b/packages/adapters/hermes/src/gateway/server/execute.test.ts index 7efdac23bd..dbf27125d3 100644 --- a/packages/adapters/hermes/src/gateway/server/execute.test.ts +++ b/packages/adapters/hermes/src/gateway/server/execute.test.ts @@ -208,7 +208,7 @@ describe("execute", () => { expect(prompt).not.toContain("Create child issues"); }); - it("sends the task brief once on fresh runs and compacts it on stable-session resumes", async () => { + it("sends the current task brief once on fresh runs and stable-session resumes", async () => { const description = "Update launch-card.svg and change the CTA to Try Team free."; const fullTaskMarkdown = [ "Paperclip task context:", @@ -271,9 +271,9 @@ describe("execute", () => { expect(runBodies).toHaveLength(2); // Fresh run: brief exactly once (task markdown only; wake-prompt copy suppressed). expect(runBodies[0]!.input.split(description)).toHaveLength(2); - // Stable-session resume: compact task markdown, no re-sent brief. + // Stable-session resume: current brief exactly once, with no duplicate wake copy. expect(runBodies[1]!.input).toContain("Paperclip task context:"); - expect(runBodies[1]!.input).not.toContain(description); + expect(runBodies[1]!.input.split(description)).toHaveLength(2); }); it("routes a bare Hermes dashboard URL on port 9119 through the API prefix", async () => {