From 965cc29cb92d849153d236a4a08527f57d57696c Mon Sep 17 00:00:00 2001 From: Gajae Bot Date: Sun, 4 Oct 2026 18:00:05 +0000 Subject: [PATCH] test(acp): align cancel-grace terminal test with acknowledged-cancel settlement #6322 made a stopped terminal that races in after an acknowledged client cancel settle the prompt as cancelled (ACP: a cancelled prompt responds with the cancelled stop reason). The older test still pinned the racing terminal's own reason (refusal), so dev shard 7 fails deterministically on df6c3260. --- packages/coding-agent/test/sdk-acp-prompt-terminal.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/coding-agent/test/sdk-acp-prompt-terminal.test.ts b/packages/coding-agent/test/sdk-acp-prompt-terminal.test.ts index 5848cc1dcf6..44db7e78957 100644 --- a/packages/coding-agent/test/sdk-acp-prompt-terminal.test.ts +++ b/packages/coding-agent/test/sdk-acp-prompt-terminal.test.ts @@ -3297,14 +3297,14 @@ test("ACP cancel grace preserves background activity that starts after acknowled } }); -test("ACP keeps the authoritative terminal when it arrives inside the cancel grace", async () => { +test("ACP settles an acknowledged cancel as cancelled when a stopped terminal arrives inside the cancel grace", async () => { const fixture = await createFixture({ cancelSettlementGraceMs: 1_000 }); try { const pending = prompt(fixture, "cancel with terminal"); await bounded(fixture.promptDelivered, "prompt delivery"); await bounded(fixture.agent.cancel({ sessionId: fixture.sessionId }), "cancel acknowledgement"); fixture.sendStopped("refusal"); - expect(await bounded(pending, "terminal settlement")).toEqual({ stopReason: "refusal" }); + expect(await bounded(pending, "terminal settlement")).toEqual({ stopReason: "cancelled" }); } finally { fixture.dispose(); }