@devries-cameron20 / t3code Mirror · read-only / commits / 076aacca16
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 10:45 UTC

fix(acp): cancelled ACP tool calls no longer stay running and end as completed (#25559)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

MarcoDotIO committed Oct 30, 2026 at 17:16 UTC 076aacca16eed7c603140aab2888bb3f75cbf342
2 files changed +33
packages/provider-acp/src/server/runtimeModel.test.ts
+32
@@ -296,6 +296,38 @@ describe("AcpRuntimeModel", () => {
296 }
297 });
298
299 + it("ends a tool call that ACP reports as cancelled", () => {
300 + const toolCall = (status: EffectAcpSchema.ToolCallStatus) => {
301 + const parsed = parseSessionUpdateEvent({
302 + sessionId: "session-1",
303 + update: {
304 + sessionUpdate: status === "in_progress" ? "tool_call" : "tool_call_update",
305 + toolCallId: "tool-1",
306 + title: "Run `sleep 60`",
307 + kind: "execute",
308 + status,
309 + },
310 + } as EffectAcpSchema.SessionNotification);
311 + const event = parsed.events[0];
312 + if (event?._tag !== "ToolCallUpdated") {
313 + throw new Error("expected a tool call update");
314 + }
315 + return event.toolCall;
316 + };
317 +
318 + const running = toolCall("in_progress");
319 + const cancelled = mergeToolCallState(running, toolCall("cancelled"));
320 + expect(cancelled.status).toBe("failed");
321 + expect(
322 + decideToolCallUpdateEmission({
323 + previous: running,
324 + next: cancelled,
325 + lastEmittedDetailLength: 0,
326 + skippedSinceEmit: 0,
327 + }).emit,
328 + ).toBe(true);
329 + });
330 +
331 it("clears prior ACP locations when an update explicitly replaces them", () => {
332 const toolCall = (locations?: EffectAcpSchema.ToolCallLocation[] | null) => {
333 const parsed = parseSessionUpdateEvent({
packages/provider-acp/src/server/runtimeModel.ts
+1
@@ -522,6 +522,7 @@ function normalizeToolCallStatus(
522 case "completed":
523 return "completed";
524 case "failed":
525 + case "cancelled":
526 return "failed";
527 default:
528 return fallback;