@agentclientprotocol/claude-agent-acp 0.90.1-preview.1 → 0.90.1-preview.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -42,7 +42,8 @@ Task subagent as its own child session, following the [subagents RFD](https://gi
42
42
 
43
43
  - `subagent_update` on the parent announces the child before any of its traffic, with the
44
44
  parent's `title` and `description` for it, and reports its work state: `running`,
45
- `requires_action` while one of its requests is open, and `idle` when its work ends, with
45
+ `requires_action` while one of its requests is open (and `running` again when the last one ends,
46
+ unless a cancel withdrew it: the child is stopping then), and `idle` when its work ends, with
46
47
  `end_turn` or `cancelled` when the SDK gives the reason. A failure is `idle` with the `error`
47
48
  stop reason and the SDK's error text as its `error`. The child keeps its session for every
48
49
  delegation to it.
@@ -55,7 +56,9 @@ Task subagent as its own child session, following the [subagents RFD](https://gi
55
56
  withdrawn. The adapter ends no child at a cancel itself, so a child that keeps running keeps its
56
57
  open requests and its open tool calls. A tool call of a stopped child that Claude Code reports no
57
58
  result for, such as the command it was running, ends in the child's session before the cancelled
58
- prompt resolves. A child that still runs when Claude Code exits is `idle` with no stop reason.
59
+ prompt resolves. When Claude Code stops a background child after that, or while no prompt runs,
60
+ the tool call ends right after the child reports `idle`. A child that still runs when Claude Code
61
+ exits is `idle` with no stop reason.
59
62
  - A child whose parent is not yet known when it ends is not exposed, since the RFD forbids
60
63
  guessing its parent.
61
64
  - A replay restores each child under its live session id, from its own transcript: its prompt and
@@ -286,6 +286,15 @@ type Turn = {
286
286
  /** Settles once the turn has ended or failed. */
287
287
  completion?: Promise<void>;
288
288
  };
289
+ /** A permission or elicitation request that awaits user input. */
290
+ type OpenUserInput = {
291
+ /** The subagent that asked: absent for the main conversation and for a
292
+ * request that names no agent. */
293
+ agentID?: string;
294
+ /** Set by a cancel that comes while the request is open (see
295
+ * `withPendingUserInput`). */
296
+ cancelled?: boolean;
297
+ };
289
298
  export type Session = {
290
299
  query: Query;
291
300
  input: Pushable<SDKUserMessage>;
@@ -492,15 +501,11 @@ export type Session = {
492
501
  /** Whether nested subagent text/thinking is forwarded to the ACP client.
493
502
  * Enabled by either the ACP capability or the pre-existing SDK option. */
494
503
  forwardSubagentText: boolean;
495
- /** The ACP permission and elicitation requests that await user input, each
496
- * with the subagent that asked (`agentID`, absent for the main
497
- * conversation and for a request that names no agent). Parallel subagents
498
- * can ask concurrently. Steering stays non-interrupting while any request
499
- * is open; the foreground work awaits the user while one that blocks it is
500
- * open (see {@link blocksForeground}). */
501
- openUserInputs?: Set<{
502
- agentID?: string;
503
- }>;
504
+ /** The ACP permission and elicitation requests that await user input.
505
+ * Parallel subagents can ask concurrently. Steering stays non-interrupting
506
+ * while any request is open; the foreground work awaits the user while one
507
+ * that blocks it is open (see {@link blocksForeground}). */
508
+ openUserInputs?: Set<OpenUserInput>;
504
509
  /** Context window size of the session's current model, carried across
505
510
  * prompts so mid-stream usage_update notifications report a correct `size`
506
511
  * before the turn's first result message arrives. Seeded synchronously at
@@ -557,6 +562,16 @@ export type Session = {
557
562
  * not here: Claude abandoned it before it ran. Pruned when the call ends;
558
563
  * the oldest entries are dropped. */
559
564
  dispatchedToolCalls?: Set<string>;
565
+ /** The tool uses that the consumer reached in the stream, each with whether
566
+ * it dropped it as output of the work a cancel stopped (`true`, see
567
+ * `dropsStoppedWorkOutput`). The first sight of a tool use decides: its
568
+ * streamed start, or its complete message. `canUseTool` and the v2 preview
569
+ * hook read it (see `isStoppedWorkToolUse`). The oldest entries are
570
+ * dropped. */
571
+ reachedToolUses?: Map<string, boolean>;
572
+ /** What waits for the consumer to reach each tool use (see
573
+ * `isStoppedWorkToolUse`). */
574
+ toolUseWaiters?: Map<string, Set<() => void>>;
560
575
  /** For each open tool call that a subagent made: the Agent/Task call that
561
576
  * started that subagent. When a cancel ends such a call, the report names
562
577
  * that parent as the call's other updates do, so that every client form
@@ -998,6 +1013,9 @@ export declare class ClaudeAcpAgent {
998
1013
  * return "cancelled". See {@link DEFAULT_FORCE_CANCEL_GRACE_MS}. Mutable so
999
1014
  * tests can shrink it. */
1000
1015
  forceCancelGraceMs: number;
1016
+ /** How long `canUseTool` or a hook waits for the consumer to reach a tool
1017
+ * use (see `isStoppedWorkToolUse`). Mutable so tests can shrink it. */
1018
+ toolUseWaitMs: number;
1001
1019
  /**
1002
1020
  * The connection serves ACP v2 (`src/v2/`). The agent still speaks v1
1003
1021
  * types, except for the tool call content that v2 needs and v1 cannot
@@ -1008,7 +1026,8 @@ export declare class ClaudeAcpAgent {
1008
1026
  private readonly foregroundEvents?;
1009
1027
  /**
1010
1028
  * The foreground work of each session while it runs, by the session id that
1011
- * the client knows. A clear-context restart replaces the Claude Code session
1029
+ * the client knows, on every connection: only the `foreground` option
1030
+ * reports it. A clear-context restart replaces the Claude Code session
1012
1031
  * behind that id and moves the running turn to it, so the work belongs to the
1013
1032
  * id, not to a {@link Session}.
1014
1033
  */
@@ -1020,8 +1039,9 @@ export declare class ClaudeAcpAgent {
1020
1039
  /**
1021
1040
  * Where the agent reports a session's foreground work (see
1022
1041
  * {@link ForegroundEvents}), called each time work starts in the session
1023
- * `sessionId`. Without it, nothing reports the work: a v1 client has no
1024
- * session state, and learns that a turn ended from its prompt response.
1042
+ * `sessionId`. Without it, nothing reports the work, which the agent
1043
+ * still tracks: a v1 client has no session state, and learns that a turn
1044
+ * ended from its prompt response.
1025
1045
  */
1026
1046
  foreground?: (sessionId: string) => ForegroundEvents;
1027
1047
  });
@@ -1375,13 +1395,23 @@ export declare class ClaudeAcpAgent {
1375
1395
  /** Runs `request`, a request that `requestSessionId` sends for the session
1376
1396
  * `ownerSessionId`. When that is a subagent's child session, the child
1377
1397
  * reports that it awaits the user while the request is open (the RFD form,
1378
- * see `NativeSubagentRuntime.awaitingUser`). */
1398
+ * see `NativeSubagentRuntime.awaitingUser`). `signal` aborts when Claude
1399
+ * Code withdraws the request. */
1379
1400
  private withChildAwaitingUser;
1380
1401
  /** Mark a client request of the subagent `agentID` (absent for the main
1381
1402
  * conversation) as awaiting user input for exactly the lifetime of its
1382
1403
  * promise (see `Session.openUserInputs`). Steering consults the open
1383
1404
  * requests synchronously, so a message arriving while any permission or
1384
- * elicitation card is open uses non-interrupting SDK delivery. */
1405
+ * elicitation card is open uses non-interrupting SDK delivery.
1406
+ *
1407
+ * `signal` aborts when Claude Code withdraws the request, which is not an
1408
+ * answer. Example: the user cancels while a permission request is open.
1409
+ * Claude Code's interrupt withdraws it as it stops the work, and the work
1410
+ * ends `idle cancelled` right after. The end of the request then reports
1411
+ * no `running`: the client would see `requires_action`, `running`, `idle
1412
+ * cancelled`. A withdrawal without a cancel means that something else
1413
+ * answered the request in the user's place, such as a `PermissionRequest`
1414
+ * hook, and the work goes on, so the end reports `running`. */
1385
1415
  private withPendingUserInput;
1386
1416
  /** Report whether the session's foreground work awaits the user: exactly
1387
1417
  * while a permission request or question that blocks it is open (see
@@ -1389,7 +1419,12 @@ export declare class ClaudeAcpAgent {
1389
1419
  * and Claude Code can ask for a queued prompt before the consumer activates
1390
1420
  * it, so a request is not tied to the work that was running when it
1391
1421
  * opened. Called when a request opens or closes, when a turn activates, and
1392
- * when a task registers or moves to the background. */
1422
+ * when a task registers or moves to the background.
1423
+ *
1424
+ * When the last request ends, the work reports `running` again, unless a
1425
+ * cancel withdrew that request (`withdrawnByCancel`, see
1426
+ * {@link withPendingUserInput}): the work is being stopped, and reports its
1427
+ * end next. */
1393
1428
  private syncAwaitingUser;
1394
1429
  /** Make `owner` the foreground work of the session `sessionId` (see
1395
1430
  * {@link ForegroundEvents}): it reports `running`, then waits at once if a
@@ -1410,11 +1445,43 @@ export declare class ClaudeAcpAgent {
1410
1445
  /** Whether the client has been told that the session's work ended: on v2 by
1411
1446
  * an idle state, so no foreground work is open, including a cycle that
1412
1447
  * Claude Code started on its own; on v1 by the response to the turn's
1413
- * prompt, so no turn is active. */
1448
+ * prompt, so no turn is active. v1 reports nothing for a cycle, so its end
1449
+ * is its result or idle: until then, Claude Code's results for the cycle's
1450
+ * tool calls still reach the client after a cancel. */
1414
1451
  private workEndReported;
1452
+ /** Whether the consumer drops what it reaches now as output of the work a
1453
+ * cancel stopped: the client has been told that the work ended, and the
1454
+ * window after the cancel is still open (see Session.cancelled). */
1455
+ private dropsStoppedWorkOutput;
1456
+ /**
1457
+ * Whether the tool use `toolUseId`, which reaches `canUseTool` or a hook, is
1458
+ * output of the work a cancel stopped that the consumer dropped (see
1459
+ * `dropsStoppedWorkOutput`). Example: Claude Code runs a prompt that the
1460
+ * cancel abandoned, and it asks to run a command. The consumer drops the
1461
+ * tool use and its result, so a tool call shown for it would never end, and
1462
+ * the client would keep it open (issue #1061).
1463
+ *
1464
+ * Claude Code calls `canUseTool` and hooks on its control channel, after it
1465
+ * streamed the tool use, and the consumer can lag behind. So the session can
1466
+ * still look cancelled while the consumer has the next prompt's echo, which
1467
+ * ends the window, still ahead of the tool use. While a cancel's window may
1468
+ * be open, this waits until the consumer reaches the tool use, for at most
1469
+ * {@link toolUseWaitMs} or until `signal` aborts: the stream never shows
1470
+ * some tool uses, such as SandboxNetworkAccess's. Without a cancel nothing
1471
+ * is dropped, so it answers at once. It returns a promise only when it
1472
+ * waits, so a permission request without a cancel goes out as soon as
1473
+ * before.
1474
+ */
1475
+ private isStoppedWorkToolUse;
1476
+ /** Waits until the consumer reaches the tool use `toolUseId` (see
1477
+ * `isStoppedWorkToolUse`), then says whether it dropped it. */
1478
+ private reachedInStream;
1415
1479
  /** End the session's model cycle that Claude Code started on its own, if one
1416
1480
  * runs. */
1417
1481
  private endAutonomousCycle;
1482
+ /** Whether a model cycle that Claude Code started on its own is the session's
1483
+ * foreground work. A turn that took a cycle over owns the work from then on. */
1484
+ private runsAutonomousCycle;
1418
1485
  /** Forward a permission request to the client, wiring the tool call's
1419
1486
  * `signal` through as a `cancellationSignal`. When the turn is cancelled
1420
1487
  * while the client's prompt is still open the signal aborts, the SDK sends
@@ -1422,6 +1489,15 @@ export declare class ClaudeAcpAgent {
1422
1489
  * ignores it. A `cancelled` outcome, request rejection, and local abort all
1423
1490
  * surface the same "Tool use aborted" the callers already expect. */
1424
1491
  private requestPermissionFromClient;
1492
+ /** Send the client an elicitation for a callback of Claude Code. When the
1493
+ * callback's `signal` aborts, the SDK sends `$/cancel_request` and keeps
1494
+ * waiting for the client's reply, which a client that ignores the cancel
1495
+ * never sends. So the call also rejects at once on the abort, as
1496
+ * {@link requestPermissionFromClient} does for a permission request. Left
1497
+ * open, the request would stay in `openUserInputs` (see
1498
+ * {@link withPendingUserInput}), which keeps steering non-interrupting, and
1499
+ * a child's `openRequests` would not drop. */
1500
+ private elicitFromClient;
1425
1501
  /** Emit the `tool_call` a permission request references if it hasn't been sent
1426
1502
  * yet, so the client has the tool call before being asked to approve it. The
1427
1503
  * matching streamed tool_use chunk later refines it with a `tool_call_update`
@@ -1 +1 @@
1
- {"version":3,"file":"acp-agent.d.ts","sourceRoot":"","sources":["../src/acp-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAER,mBAAmB,EAEnB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,+BAA+B,EAC/B,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EAErB,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EAGb,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,cAAc,EAEd,mBAAmB,EACnB,oBAAoB,EAEpB,kBAAkB,EAClB,mBAAmB,EAEnB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACr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E,sBAAsB,CAAC;CAC7C,GACA,mBAAmB,EAAE,CAsHvB;AAED;;;;;;;;;;;oEAWoE;AACpE,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC,EAC3D,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,cAAc,CAAC,CAczB;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,GACvC,QAAQ,CA0CV;AAED,8BAA8B;AAC9B,wBAAgB,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM;;;EAMrC"}
package/dist/acp-agent.js CHANGED
@@ -87,6 +87,11 @@ const STRUCTURED_USAGE_TIMEOUT_MS = 5_000;
87
87
  * The teardown wakes the consumer itself, so they end within a few ticks
88
88
  * unless the consumer is wedged. */
89
89
  const TEARDOWN_TURN_END_TIMEOUT_MS = 5_000;
90
+ /** How long `canUseTool` or a hook waits, while a cancel's window may be
91
+ * open, for the consumer to reach a tool use in the stream. Claude Code
92
+ * streams the tool use before it asks, so the consumer is usually there
93
+ * within a few ticks. */
94
+ const TOOL_USE_WAIT_MS = 2_000;
90
95
  /** The number of settled subagents whose parent tool call a session keeps for
91
96
  * a later resume (see `resumableSubagents`). */
92
97
  const MAX_RESUMABLE_SUBAGENTS = 256;
@@ -285,6 +290,15 @@ const AUTONOMOUS_RESULT_ORIGINS = new Set([
285
290
  * or a model cycle that Claude Code started on its own. At most one cycle
286
291
  * runs at a time, so a constant names it. */
287
292
  const AUTONOMOUS_CYCLE = "autonomous-cycle";
293
+ /** The events of a connection that reports no foreground work: v1, whose
294
+ * client has no session state. The agent still tracks the work, which
295
+ * decides what the window after a cancel drops (see `workEndReported`). */
296
+ const UNREPORTED_FOREGROUND = {
297
+ running: () => { },
298
+ awaitingUser: () => { },
299
+ ended: () => { },
300
+ failed: () => { },
301
+ };
288
302
  /** Whether this turn's terminal result arrived but its settlement is being
289
303
  * held for background subagents it spawned (see Turn.deferredSettle). The
290
304
  * single spelling of the hold predicate, shared by the consumer's settle
@@ -1161,6 +1175,9 @@ export class ClaudeAcpAgent {
1161
1175
  * return "cancelled". See {@link DEFAULT_FORCE_CANCEL_GRACE_MS}. Mutable so
1162
1176
  * tests can shrink it. */
1163
1177
  forceCancelGraceMs = DEFAULT_FORCE_CANCEL_GRACE_MS;
1178
+ /** How long `canUseTool` or a hook waits for the consumer to reach a tool
1179
+ * use (see `isStoppedWorkToolUse`). Mutable so tests can shrink it. */
1180
+ toolUseWaitMs = TOOL_USE_WAIT_MS;
1164
1181
  /**
1165
1182
  * The connection serves ACP v2 (`src/v2/`). The agent still speaks v1
1166
1183
  * types, except for the tool call content that v2 needs and v1 cannot
@@ -1171,7 +1188,8 @@ export class ClaudeAcpAgent {
1171
1188
  foregroundEvents;
1172
1189
  /**
1173
1190
  * The foreground work of each session while it runs, by the session id that
1174
- * the client knows. A clear-context restart replaces the Claude Code session
1191
+ * the client knows, on every connection: only the `foreground` option
1192
+ * reports it. A clear-context restart replaces the Claude Code session
1175
1193
  * behind that id and moves the running turn to it, so the work belongs to the
1176
1194
  * id, not to a {@link Session}.
1177
1195
  */
@@ -3150,8 +3168,14 @@ export class ClaudeAcpAgent {
3150
3168
  /** Sends `report`, which ends the tool call `toolCallId` without its result
3151
3169
  * (see `AcpToolCallRenderer.unfinished`), and forgets the call. Forgetting
3152
3170
  * comes first, so that a late hook or a second close cannot overwrite the
3153
- * report. */
3171
+ * report. A command has a display terminal on a client that renders them,
3172
+ * and no result will end it, so the report ends it too. */
3154
3173
  const closeToolCall = async (toolCallId, report) => {
3174
+ // Read before the cache entry goes: it names the tool.
3175
+ const toolUse = session.toolUseCache[toolCallId];
3176
+ const terminalExit = toolUse && new AcpToolCallRenderer(this.toolCallCapabilities).terminalExit(toolUse);
3177
+ if (terminalExit)
3178
+ report._meta = { ...report._meta, ...terminalExit };
3155
3179
  unregisterHookCallback(toolCallId);
3156
3180
  session.emittedToolCalls.delete(toolCallId);
3157
3181
  delete session.toolUseCache[toolCallId];
@@ -3166,26 +3190,24 @@ export class ClaudeAcpAgent {
3166
3190
  task.backgrounded === true &&
3167
3191
  !task.endedPerLevel &&
3168
3192
  task.parentToolUseId === agentToolUseId);
3169
- /** Closes the tool calls that the work a cancel stopped left open, as that
3170
- * work ends. Claude Code's interrupt ends each running tool of the main
3171
- * conversation with an error result, which `sendInterruptedToolResults`
3172
- * delivers. What is still open here has no result to deliver:
3173
- * - a tool of a subagent: Claude Code writes its interrupted result only to
3174
- * the subagent's own transcript, not to the stream;
3175
- * - a tool call that Claude abandoned before it ran;
3176
- * - every tool call, when the stream gives no results at all, as when the
3177
- * force-cancel backstop ends a wedged turn.
3178
- * A foreground subagent ends with the work that waits on it. A background
3179
- * subagent keeps its tool calls open until the SDK reports its end, which
3180
- * Claude Code 2.1.293 does for the ones it stops, before the turn's result
3181
- * (see `NativeSubagentRuntime.parentCancelled`).
3182
- * Runs once per turn: a second call, from the other settling path, waits
3183
- * for the first (see `Turn.closingCancelledToolCalls`). */
3184
- const closeCancelledToolCalls = (turn) => (turn.closingCancelledToolCalls ??= (async () => {
3193
+ /** Whether output of the conversation `parentToolUseId` (null for the main
3194
+ * one) is a background subagent's that still runs. A cancel does not stop
3195
+ * such a subagent's work (agentclientprotocol/agent-client-protocol#2308):
3196
+ * the closing at the cancel leaves its tool calls open for their results
3197
+ * (`closedAtCancel`), and the window after the cancel lets its output
3198
+ * through (see the `session.cancelled` checks of the stream and the
3199
+ * user/assistant cases). Claude Code currently stops background subagents
3200
+ * at an interrupt, so this decides only the output that comes before the
3201
+ * SDK reports a subagent's end. */
3202
+ const isRunningBackgroundSubagentOutput = (parentToolUseId) => parentToolUseId !== null && runsInBackground(parentToolUseId);
3203
+ /** Ends the open tool calls that `include` accepts, with the report of a call
3204
+ * that a cancel stopped and sent no result for. `include` gets the Agent/Task
3205
+ * call of the subagent that made the tool call, if a subagent did. */
3206
+ const closeOpenToolCalls = async (include) => {
3185
3207
  const renderer = new AcpToolCallRenderer(this.toolCallCapabilities);
3186
3208
  for (const toolCallId of [...session.emittedToolCalls]) {
3187
3209
  const parentToolUseId = session.toolCallParents?.get(toolCallId);
3188
- if (parentToolUseId !== undefined && runsInBackground(parentToolUseId))
3210
+ if (!include(parentToolUseId))
3189
3211
  continue;
3190
3212
  const report = renderer.unfinished({
3191
3213
  toolCallId,
@@ -3198,8 +3220,48 @@ export class ClaudeAcpAgent {
3198
3220
  stampParentToolUseId(report, parentToolUseId);
3199
3221
  await closeToolCall(toolCallId, report);
3200
3222
  }
3201
- })());
3223
+ };
3224
+ /** Whether the closing at the end of the work a cancel stopped takes a tool
3225
+ * call that the subagent started by the Agent call `parentToolUseId` made
3226
+ * (undefined for a call of the main conversation): not one of a running
3227
+ * background subagent, which the cancel may not have stopped. */
3228
+ const closedAtCancel = (parentToolUseId) => parentToolUseId === undefined || !runsInBackground(parentToolUseId);
3229
+ /** Closes the tool calls that the work a cancel stopped left open, as that
3230
+ * work ends. Claude Code's interrupt ends each running tool of the main
3231
+ * conversation with an error result, which `sendInterruptedToolResults`
3232
+ * delivers. What is still open here has no result to deliver:
3233
+ * - a tool of a subagent: Claude Code writes its interrupted result only to
3234
+ * the subagent's own transcript, not to the stream;
3235
+ * - a tool call that Claude abandoned before it ran;
3236
+ * - every tool call, when the stream gives no results at all, as when the
3237
+ * force-cancel backstop ends a wedged turn.
3238
+ * A foreground subagent ends with the work that waits on it. A background
3239
+ * subagent keeps its tool calls open until the SDK reports its end, which
3240
+ * Claude Code 2.1.293 does for the ones it stops, before the turn's result
3241
+ * (see `NativeSubagentRuntime.parentCancelled`). When the SDK reports it
3242
+ * only after the work ended, `closeStoppedSubagentToolCalls` closes them.
3243
+ * Runs once per turn: a second call, from the other settling path, waits
3244
+ * for the first (see `Turn.closingCancelledToolCalls`). */
3245
+ const closeCancelledToolCalls = (turn) => (turn.closingCancelledToolCalls ??= closeOpenToolCalls(closedAtCancel));
3202
3246
  session.closeCancelledToolCalls = closeCancelledToolCalls;
3247
+ /** Closes the tool calls of the subagent that the Agent call `agentToolUseId`
3248
+ * started, once the SDK reports the subagent stopped, if a cancel stopped it
3249
+ * after the work that waited on it ended. Nothing else ends them then.
3250
+ * Example: the cancel settles a turn that v1 holds for a background
3251
+ * subagent, so `closeCancelledToolCalls` leaves the subagent's command
3252
+ * open, since the subagent runs. Claude Code's interrupt then stops the
3253
+ * subagent. Claude Code 2.1.296 sends the command's interrupted result
3254
+ * after that, but the result is dropped like all output after the work's
3255
+ * end (see the `session.cancelled` check of the user/assistant case).
3256
+ * While the work still runs, the calls of a stopped subagent get Claude
3257
+ * Code's result, or `closeCancelledToolCalls` at the work's end. */
3258
+ const closeStoppedSubagentToolCalls = async (agentToolUseId) => {
3259
+ if (!agentToolUseId || !session.cancelled)
3260
+ return;
3261
+ if (!this.workEndReported(params.sessionId, session))
3262
+ return;
3263
+ await closeOpenToolCalls((parentToolUseId) => parentToolUseId === agentToolUseId);
3264
+ };
3203
3265
  /** Delivers the results that the work a cancel stopped sends for tool calls
3204
3266
  * that the client holds open. Claude Code's interrupt ends each running tool
3205
3267
  * of the main conversation with an error result, before the result that
@@ -3233,6 +3295,47 @@ export class ClaudeAcpAgent {
3233
3295
  await sendUpdate(notification);
3234
3296
  }
3235
3297
  };
3298
+ /** The model cycle that Claude Code started on its own ends, and its end is
3299
+ * about to be reported: closes the tool calls that it left open first. A
3300
+ * cycle is foreground work that no turn settles, so neither
3301
+ * `closeCancelledToolCalls` nor the check of `settleActive` for unfinished
3302
+ * tools runs for it. A turn that took the cycle over closes its own calls,
3303
+ * when it settles.
3304
+ *
3305
+ * After a cancel, Claude Code's interrupt gives the tools of the main
3306
+ * conversation results, which `sendInterruptedToolResults` delivers while
3307
+ * the cycle runs. What is still open has none, such as the command of a
3308
+ * foreground subagent. The follow-up of a turn that v1 holds for its
3309
+ * background subagents is a cycle too, and the cancel ends the held turn
3310
+ * as well, possibly in `cancelTurns` while these reports are in flight. So
3311
+ * the cycle's calls close with the held turn's closing, which each settle
3312
+ * of the turn waits for, and the response never comes before them.
3313
+ *
3314
+ * At any other end, every call that ran has its result. What is open is a
3315
+ * call of the main conversation that Claude abandoned before it ran, such
3316
+ * as a streamed tool_use that never reached a complete message, which a
3317
+ * turn's end closes the same way (`closeUnfinished`). The calls of a
3318
+ * subagent are not the cycle's: a background subagent runs on. */
3319
+ const closeCycleToolCalls = async () => {
3320
+ if (!this.runsAutonomousCycle(params.sessionId))
3321
+ return;
3322
+ if (session.cancelled) {
3323
+ const held = session.activeTurn;
3324
+ if (held && !held.settled)
3325
+ await closeCancelledToolCalls(held);
3326
+ else
3327
+ await closeOpenToolCalls(closedAtCancel);
3328
+ return;
3329
+ }
3330
+ const renderer = new AcpToolCallRenderer(this.toolCallCapabilities);
3331
+ for (const toolCallId of [...session.emittedToolCalls]) {
3332
+ if (session.toolCallParents?.has(toolCallId))
3333
+ continue;
3334
+ if (session.dispatchedToolCalls?.has(toolCallId))
3335
+ continue;
3336
+ await closeToolCall(toolCallId, renderer.unfinished({ toolCallId, ran: false }));
3337
+ }
3338
+ };
3236
3339
  /** At the actual turn boundary, preview its checkpoint, settle the active
3237
3340
  * turn exactly once, disarm the force-cancel backstop, and drop it from
3238
3341
  * the queue. Cancellation and provider failures skip checkpoint I/O. */
@@ -3882,6 +3985,7 @@ export class ClaudeAcpAgent {
3882
3985
  // here. An owed idle belongs to an earlier result: it can lag
3883
3986
  // past the cycle's first output.
3884
3987
  if (session.owedTrailingIdles === 0) {
3988
+ await closeCycleToolCalls();
3885
3989
  this.endAutonomousCycle(params.sessionId, {
3886
3990
  outcome: { stopReason: session.cancelled ? "cancelled" : "end_turn" },
3887
3991
  });
@@ -4232,6 +4336,9 @@ export class ClaudeAcpAgent {
4232
4336
  droppedStreams.delete(message.tool_use_id);
4233
4337
  }
4234
4338
  await endBackgroundTerminal(message.task_id);
4339
+ if (message.status === "stopped") {
4340
+ await closeStoppedSubagentToolCalls(message.tool_use_id);
4341
+ }
4235
4342
  settleLiveTask(message.task_id);
4236
4343
  break;
4237
4344
  case "task_updated":
@@ -4263,6 +4370,9 @@ export class ClaudeAcpAgent {
4263
4370
  droppedStreams.delete(parentToolUseId);
4264
4371
  }
4265
4372
  await endBackgroundTerminal(message.task_id);
4373
+ if (message.patch.status === "killed") {
4374
+ await closeStoppedSubagentToolCalls(parentToolUseId);
4375
+ }
4266
4376
  settleLiveTask(message.task_id);
4267
4377
  }
4268
4378
  else if (message.patch.status === "running" ||
@@ -4698,6 +4808,7 @@ export class ClaudeAcpAgent {
4698
4808
  pendingExitPlanContextReset?.toolUseId ===
4699
4809
  pendingExitPlanModeInterruption?.toolUseId;
4700
4810
  if (!continuesPlan && !(isAutonomousResult && message.num_turns === 0)) {
4811
+ await closeCycleToolCalls();
4701
4812
  this.endAutonomousCycle(params.sessionId, autonomousCycleEnd(message, resultModelUsage, session.cancelled || exitPlanInterruption || isAbortedResult(message)));
4702
4813
  }
4703
4814
  if (session.cancelled) {
@@ -5156,7 +5267,8 @@ export class ClaudeAcpAgent {
5156
5267
  // `cancelled` check in the user/assistant case). Otherwise the
5157
5268
  // answer to a prompt the cancel abandoned, which Claude Code had
5158
5269
  // already taken off its queue, would stream to the client after the
5159
- // cancel was reported.
5270
+ // cancel was reported. A background subagent that still runs is not
5271
+ // work the cancel stopped (see isRunningBackgroundSubagentOutput).
5160
5272
  //
5161
5273
  // Where the consolidated message delivers the text (the same
5162
5274
  // condition as in the user/assistant case), a stream that loses a
@@ -5168,7 +5280,13 @@ export class ClaudeAcpAgent {
5168
5280
  // prefix of the text, so the text would be sent again (see
5169
5281
  // unstreamedRemainder).
5170
5282
  const streamKey = message.parent_tool_use_id ?? "";
5171
- if (session.cancelled && this.workEndReported(params.sessionId, session)) {
5283
+ const stoppedWorkOutput = this.dropsStoppedWorkOutput(params.sessionId, session) &&
5284
+ !isRunningBackgroundSubagentOutput(message.parent_tool_use_id);
5285
+ if (message.event.type === "content_block_start" &&
5286
+ isToolUseBlock(message.event.content_block)) {
5287
+ recordReachedToolUse(session, message.event.content_block.id, stoppedWorkOutput);
5288
+ }
5289
+ if (stoppedWorkOutput) {
5172
5290
  if (message.parent_tool_use_id === null || forwardsSubagentText()) {
5173
5291
  droppedStreams.add(streamKey);
5174
5292
  }
@@ -5238,8 +5356,18 @@ export class ClaudeAcpAgent {
5238
5356
  }
5239
5357
  case "user":
5240
5358
  case "assistant": {
5241
- if (message.type === "assistant")
5359
+ if (message.type === "assistant") {
5242
5360
  recordDispatchedToolUses(session, message.message.content);
5361
+ // A tool use that did not stream is reached here first.
5362
+ const content = message.message.content;
5363
+ const stoppedWorkOutput = this.dropsStoppedWorkOutput(params.sessionId, session) &&
5364
+ !isRunningBackgroundSubagentOutput(message.parent_tool_use_id);
5365
+ for (const block of Array.isArray(content) ? content : []) {
5366
+ if (isToolUseBlock(block)) {
5367
+ recordReachedToolUse(session, block.id, stoppedWorkOutput);
5368
+ }
5369
+ }
5370
+ }
5243
5371
  // Record the ACP messageId -> SDK uuid mapping for this message
5244
5372
  // (including replays). The consolidated message carries both ids, so
5245
5373
  // this is where we learn the uuid the SDK's rewind/resume APIs key on
@@ -5343,11 +5471,13 @@ export class ClaudeAcpAgent {
5343
5471
  break;
5344
5472
  }
5345
5473
  }
5346
- if (session.cancelled) {
5474
+ if (session.cancelled &&
5475
+ !isRunningBackgroundSubagentOutput(message.parent_tool_use_id)) {
5347
5476
  // The work the cancel stopped ends its tools with error results.
5348
5477
  // Until the client is told that the work ended, they close the
5349
5478
  // tool calls it opened. Everything else that work sends is
5350
- // dropped, and so is everything after that report.
5479
+ // dropped, and so is everything after that report. A background
5480
+ // subagent that still runs is not that work: its messages go on.
5351
5481
  if (message.type === "user" && !this.workEndReported(params.sessionId, session)) {
5352
5482
  await sendInterruptedToolResults(message);
5353
5483
  }
@@ -5778,6 +5908,10 @@ export class ClaudeAcpAgent {
5778
5908
  return;
5779
5909
  }
5780
5910
  session.cancelled = true;
5911
+ // The interrupt below makes Claude Code withdraw the requests that are open
5912
+ // now (see `withPendingUserInput`).
5913
+ for (const input of session.openUserInputs ?? [])
5914
+ input.cancelled = true;
5781
5915
  // Before anything awaits, so a model request that the consumer reads in
5782
5916
  // the meantime is already judged against these prompts.
5783
5917
  session.cancelledPrompts ??= new Set();
@@ -6706,19 +6840,29 @@ export class ClaudeAcpAgent {
6706
6840
  /** Runs `request`, a request that `requestSessionId` sends for the session
6707
6841
  * `ownerSessionId`. When that is a subagent's child session, the child
6708
6842
  * reports that it awaits the user while the request is open (the RFD form,
6709
- * see `NativeSubagentRuntime.awaitingUser`). */
6710
- withChildAwaitingUser(ownerSessionId, requestSessionId, request) {
6843
+ * see `NativeSubagentRuntime.awaitingUser`). `signal` aborts when Claude
6844
+ * Code withdraws the request. */
6845
+ withChildAwaitingUser(ownerSessionId, requestSessionId, signal, request) {
6711
6846
  const runtime = this.sessions[ownerSessionId]?.nativeSubagentRuntime;
6712
6847
  return runtime && requestSessionId !== ownerSessionId
6713
- ? runtime.awaitingUser(requestSessionId, request)
6848
+ ? runtime.awaitingUser(requestSessionId, request, signal)
6714
6849
  : request();
6715
6850
  }
6716
6851
  /** Mark a client request of the subagent `agentID` (absent for the main
6717
6852
  * conversation) as awaiting user input for exactly the lifetime of its
6718
6853
  * promise (see `Session.openUserInputs`). Steering consults the open
6719
6854
  * requests synchronously, so a message arriving while any permission or
6720
- * elicitation card is open uses non-interrupting SDK delivery. */
6721
- async withPendingUserInput(sessionId, request, agentID) {
6855
+ * elicitation card is open uses non-interrupting SDK delivery.
6856
+ *
6857
+ * `signal` aborts when Claude Code withdraws the request, which is not an
6858
+ * answer. Example: the user cancels while a permission request is open.
6859
+ * Claude Code's interrupt withdraws it as it stops the work, and the work
6860
+ * ends `idle cancelled` right after. The end of the request then reports
6861
+ * no `running`: the client would see `requires_action`, `running`, `idle
6862
+ * cancelled`. A withdrawal without a cancel means that something else
6863
+ * answered the request in the user's place, such as a `PermissionRequest`
6864
+ * hook, and the work goes on, so the end reports `running`. */
6865
+ async withPendingUserInput(sessionId, signal, request, agentID) {
6722
6866
  const session = this.sessions[sessionId];
6723
6867
  if (!session)
6724
6868
  return request();
@@ -6730,7 +6874,8 @@ export class ClaudeAcpAgent {
6730
6874
  }
6731
6875
  finally {
6732
6876
  session.openUserInputs.delete(input);
6733
- this.syncAwaitingUser(sessionId, session);
6877
+ const withdrawnByCancel = signal.aborted && input.cancelled === true;
6878
+ this.syncAwaitingUser(sessionId, session, withdrawnByCancel);
6734
6879
  }
6735
6880
  }
6736
6881
  /** Report whether the session's foreground work awaits the user: exactly
@@ -6739,8 +6884,13 @@ export class ClaudeAcpAgent {
6739
6884
  * and Claude Code can ask for a queued prompt before the consumer activates
6740
6885
  * it, so a request is not tied to the work that was running when it
6741
6886
  * opened. Called when a request opens or closes, when a turn activates, and
6742
- * when a task registers or moves to the background. */
6743
- syncAwaitingUser(sessionId, session) {
6887
+ * when a task registers or moves to the background.
6888
+ *
6889
+ * When the last request ends, the work reports `running` again, unless a
6890
+ * cancel withdrew that request (`withdrawnByCancel`, see
6891
+ * {@link withPendingUserInput}): the work is being stopped, and reports its
6892
+ * end next. */
6893
+ syncAwaitingUser(sessionId, session, withdrawnByCancel = false) {
6744
6894
  const work = this.foregroundWork.get(sessionId);
6745
6895
  if (!work)
6746
6896
  return;
@@ -6750,7 +6900,7 @@ export class ClaudeAcpAgent {
6750
6900
  work.awaitingUser = waiting;
6751
6901
  if (waiting)
6752
6902
  work.events.awaitingUser();
6753
- else
6903
+ else if (!withdrawnByCancel)
6754
6904
  work.events.running();
6755
6905
  }
6756
6906
  /** Make `owner` the foreground work of the session `sessionId` (see
@@ -6759,14 +6909,12 @@ export class ClaudeAcpAgent {
6759
6909
  * reports nothing new: a turn takes over a cycle that Claude Code started on
6760
6910
  * its own, and only the owner's end ends the work. */
6761
6911
  startForeground(sessionId, owner) {
6762
- if (!this.foregroundEvents)
6763
- return;
6764
6912
  const current = this.foregroundWork.get(sessionId);
6765
6913
  if (current) {
6766
6914
  current.owner = owner;
6767
6915
  return;
6768
6916
  }
6769
- const events = this.foregroundEvents(sessionId);
6917
+ const events = this.foregroundEvents?.(sessionId) ?? UNREPORTED_FOREGROUND;
6770
6918
  this.foregroundWork.set(sessionId, { owner, events, awaitingUser: false });
6771
6919
  events.running();
6772
6920
  const session = this.sessions[sessionId];
@@ -6792,7 +6940,7 @@ export class ClaudeAcpAgent {
6792
6940
  * whose work ended at its result, so its follow-up is a cycle. Output of
6793
6941
  * the work a cancel stopped starts nothing (see Session.cancelled). */
6794
6942
  startAutonomousCycle(sessionId, session, message) {
6795
- if (!this.foregroundEvents || this.foregroundWork.has(sessionId) || session.cancelled)
6943
+ if (this.foregroundWork.has(sessionId) || session.cancelled)
6796
6944
  return;
6797
6945
  if (message.type !== "assistant" && message.type !== "stream_event")
6798
6946
  return;
@@ -6810,15 +6958,79 @@ export class ClaudeAcpAgent {
6810
6958
  /** Whether the client has been told that the session's work ended: on v2 by
6811
6959
  * an idle state, so no foreground work is open, including a cycle that
6812
6960
  * Claude Code started on its own; on v1 by the response to the turn's
6813
- * prompt, so no turn is active. */
6961
+ * prompt, so no turn is active. v1 reports nothing for a cycle, so its end
6962
+ * is its result or idle: until then, Claude Code's results for the cycle's
6963
+ * tool calls still reach the client after a cancel. */
6814
6964
  workEndReported(sessionId, session) {
6815
- return this.foregroundEvents ? !this.foregroundWork.has(sessionId) : !session.activeTurn;
6965
+ return this.foregroundEvents
6966
+ ? !this.foregroundWork.has(sessionId)
6967
+ : !session.activeTurn && !this.runsAutonomousCycle(sessionId);
6968
+ }
6969
+ /** Whether the consumer drops what it reaches now as output of the work a
6970
+ * cancel stopped: the client has been told that the work ended, and the
6971
+ * window after the cancel is still open (see Session.cancelled). */
6972
+ dropsStoppedWorkOutput(sessionId, session) {
6973
+ return session.cancelled && this.workEndReported(sessionId, session);
6974
+ }
6975
+ /**
6976
+ * Whether the tool use `toolUseId`, which reaches `canUseTool` or a hook, is
6977
+ * output of the work a cancel stopped that the consumer dropped (see
6978
+ * `dropsStoppedWorkOutput`). Example: Claude Code runs a prompt that the
6979
+ * cancel abandoned, and it asks to run a command. The consumer drops the
6980
+ * tool use and its result, so a tool call shown for it would never end, and
6981
+ * the client would keep it open (issue #1061).
6982
+ *
6983
+ * Claude Code calls `canUseTool` and hooks on its control channel, after it
6984
+ * streamed the tool use, and the consumer can lag behind. So the session can
6985
+ * still look cancelled while the consumer has the next prompt's echo, which
6986
+ * ends the window, still ahead of the tool use. While a cancel's window may
6987
+ * be open, this waits until the consumer reaches the tool use, for at most
6988
+ * {@link toolUseWaitMs} or until `signal` aborts: the stream never shows
6989
+ * some tool uses, such as SandboxNetworkAccess's. Without a cancel nothing
6990
+ * is dropped, so it answers at once. It returns a promise only when it
6991
+ * waits, so a permission request without a cancel goes out as soon as
6992
+ * before.
6993
+ */
6994
+ isStoppedWorkToolUse(session, toolUseId, signal) {
6995
+ const reached = session.reachedToolUses?.get(toolUseId);
6996
+ if (reached !== undefined)
6997
+ return reached;
6998
+ if (!session.cancelled || signal?.aborted)
6999
+ return false;
7000
+ return this.reachedInStream(session, toolUseId, signal);
7001
+ }
7002
+ /** Waits until the consumer reaches the tool use `toolUseId` (see
7003
+ * `isStoppedWorkToolUse`), then says whether it dropped it. */
7004
+ async reachedInStream(session, toolUseId, signal) {
7005
+ await new Promise((resolve) => {
7006
+ const waiters = (session.toolUseWaiters ??= new Map());
7007
+ let waiting = waiters.get(toolUseId);
7008
+ if (!waiting)
7009
+ waiters.set(toolUseId, (waiting = new Set()));
7010
+ const done = () => {
7011
+ clearTimeout(timer);
7012
+ signal?.removeEventListener("abort", done);
7013
+ waiting.delete(done);
7014
+ if (waiting.size === 0 && waiters.get(toolUseId) === waiting)
7015
+ waiters.delete(toolUseId);
7016
+ resolve();
7017
+ };
7018
+ const timer = setTimeout(done, this.toolUseWaitMs);
7019
+ signal?.addEventListener("abort", done, { once: true });
7020
+ waiting.add(done);
7021
+ });
7022
+ return session.reachedToolUses?.get(toolUseId) ?? false;
6816
7023
  }
6817
7024
  /** End the session's model cycle that Claude Code started on its own, if one
6818
7025
  * runs. */
6819
7026
  endAutonomousCycle(sessionId, end) {
6820
7027
  this.endForeground(sessionId, AUTONOMOUS_CYCLE, end);
6821
7028
  }
7029
+ /** Whether a model cycle that Claude Code started on its own is the session's
7030
+ * foreground work. A turn that took a cycle over owns the work from then on. */
7031
+ runsAutonomousCycle(sessionId) {
7032
+ return this.foregroundWork.get(sessionId)?.owner === AUTONOMOUS_CYCLE;
7033
+ }
6822
7034
  /** Forward a permission request to the client, wiring the tool call's
6823
7035
  * `signal` through as a `cancellationSignal`. When the turn is cancelled
6824
7036
  * while the client's prompt is still open the signal aborts, the SDK sends
@@ -6843,7 +7055,7 @@ export class ClaudeAcpAgent {
6843
7055
  // The request goes to a subagent's child session for a tool call of that
6844
7056
  // subagent, but it blocks the turn of the owner session.
6845
7057
  try {
6846
- return await this.withChildAwaitingUser(ownerSessionId, params.sessionId, () => this.withPendingUserInput(ownerSessionId, () => raceWithAbort(this.client.requestPermission(params, signal), signal), agentID));
7058
+ return await this.withChildAwaitingUser(ownerSessionId, params.sessionId, signal, () => this.withPendingUserInput(ownerSessionId, signal, () => raceWithAbort(this.client.requestPermission(params, signal), signal), agentID));
6847
7059
  }
6848
7060
  catch (error) {
6849
7061
  if (signal.aborted) {
@@ -6852,6 +7064,17 @@ export class ClaudeAcpAgent {
6852
7064
  throw error;
6853
7065
  }
6854
7066
  }
7067
+ /** Send the client an elicitation for a callback of Claude Code. When the
7068
+ * callback's `signal` aborts, the SDK sends `$/cancel_request` and keeps
7069
+ * waiting for the client's reply, which a client that ignores the cancel
7070
+ * never sends. So the call also rejects at once on the abort, as
7071
+ * {@link requestPermissionFromClient} does for a permission request. Left
7072
+ * open, the request would stay in `openUserInputs` (see
7073
+ * {@link withPendingUserInput}), which keeps steering non-interrupting, and
7074
+ * a child's `openRequests` would not drop. */
7075
+ elicitFromClient(request, signal) {
7076
+ return raceWithAbort(this.client.createElicitation(request, signal), signal);
7077
+ }
6855
7078
  /** Emit the `tool_call` a permission request references if it hasn't been sent
6856
7079
  * yet, so the client has the tool call before being asked to approve it. The
6857
7080
  * matching streamed tool_use chunk later refines it with a `tool_call_update`
@@ -6948,17 +7171,21 @@ export class ClaudeAcpAgent {
6948
7171
  * decision, and a failure only leaves the preview out.
6949
7172
  */
6950
7173
  fileChangePreviewHook(sessionId) {
6951
- return async (input, toolUseID) => {
7174
+ return async (input, toolUseID, { signal }) => {
6952
7175
  if (input.hook_event_name === "PreToolUse" && toolUseID) {
6953
- await this.previewFileChange(sessionId, input, toolUseID).catch((error) => this.logger.error(`Session ${sessionId}: failed to preview ${toolUseID}: ${error}`));
7176
+ await this.previewFileChange(sessionId, input, toolUseID, signal).catch((error) => this.logger.error(`Session ${sessionId}: failed to preview ${toolUseID}: ${error}`));
6954
7177
  }
6955
7178
  return { continue: true };
6956
7179
  };
6957
7180
  }
6958
- async previewFileChange(sessionId, input, toolUseID) {
7181
+ async previewFileChange(sessionId, input, toolUseID, signal) {
6959
7182
  const session = this.sessions[sessionId];
6960
7183
  if (!session)
6961
7184
  return;
7185
+ // As in `canUseTool`: the work a cancel stopped shows nothing.
7186
+ const stopped = this.isStoppedWorkToolUse(session, toolUseID, signal);
7187
+ if (stopped instanceof Promise ? await stopped : stopped)
7188
+ return;
6962
7189
  const toolInput = (input.tool_input ?? {});
6963
7190
  const content = await previewPatchContent(input.tool_name, toolInput, session.cwd, "v2");
6964
7191
  if (!content)
@@ -7000,6 +7227,14 @@ export class ClaudeAcpAgent {
7000
7227
  message: "Session not found",
7001
7228
  };
7002
7229
  }
7230
+ // The work a cancel stopped shows the client nothing after it was told
7231
+ // that the work ended: neither a tool call nor a request. Its tool does
7232
+ // not run.
7233
+ const stopped = this.isStoppedWorkToolUse(session, toolUseID, signal);
7234
+ if (stopped instanceof Promise ? await stopped : stopped) {
7235
+ this.logger.log(`Session ${sessionId}: denied ${toolName} ${toolUseID}, which the cancelled work asked for`);
7236
+ return { behavior: "deny", message: "The user cancelled this prompt." };
7237
+ }
7003
7238
  const { parentToolUseId, toolCallSessionId: permissionSessionId } = this.toolUseOwner(session, sessionId, agentID);
7004
7239
  if (agentID && !parentToolUseId) {
7005
7240
  // The attribution rests on task_started.task_id === canUseTool's
@@ -7152,7 +7387,7 @@ export class ClaudeAcpAgent {
7152
7387
  return { action: "decline" };
7153
7388
  }
7154
7389
  try {
7155
- const response = await this.withPendingUserInput(sessionId, () => this.client.createElicitation(createRequest, signal));
7390
+ const response = await this.withPendingUserInput(sessionId, signal, () => this.elicitFromClient(createRequest, signal));
7156
7391
  if (signal.aborted) {
7157
7392
  return { action: "cancel" };
7158
7393
  }
@@ -7184,7 +7419,7 @@ export class ClaudeAcpAgent {
7184
7419
  const createRequest = askUserQuestionsToCreateRequest(questions, requestSessionId, toolUseID, this.toolCallCapabilities.air.client);
7185
7420
  let response;
7186
7421
  try {
7187
- response = await this.withChildAwaitingUser(sessionId, requestSessionId, () => this.withPendingUserInput(sessionId, () => this.client.createElicitation(createRequest, signal), agentID));
7422
+ response = await this.withChildAwaitingUser(sessionId, requestSessionId, signal, () => this.withPendingUserInput(sessionId, signal, () => this.elicitFromClient(createRequest, signal), agentID));
7188
7423
  }
7189
7424
  catch (error) {
7190
7425
  // A cancellation we requested (signal aborted) settles as an aborted tool
@@ -7224,7 +7459,7 @@ export class ClaudeAcpAgent {
7224
7459
  }
7225
7460
  let response;
7226
7461
  try {
7227
- response = await this.withPendingUserInput(sessionId, () => this.client.createElicitation(refusalFallbackToCreateRequest(prompt, sessionId), signal));
7462
+ response = await this.withPendingUserInput(sessionId, signal, () => this.elicitFromClient(refusalFallbackToCreateRequest(prompt, sessionId), signal));
7228
7463
  }
7229
7464
  catch (error) {
7230
7465
  // A cancellation we requested (signal aborted) is expected teardown;
@@ -9217,14 +9452,38 @@ function recordDispatchedToolUses(session, content) {
9217
9452
  if (!Array.isArray(content))
9218
9453
  return;
9219
9454
  for (const block of content) {
9220
- if ((block?.type === "tool_use" ||
9221
- block?.type === "server_tool_use" ||
9222
- block?.type === "mcp_tool_use") &&
9223
- typeof block.id === "string") {
9455
+ if (isToolUseBlock(block))
9224
9456
  recordDispatchedToolCall(session, block.id);
9225
- }
9226
9457
  }
9227
9458
  }
9459
+ function isToolUseBlock(block) {
9460
+ const { type, id } = (block ?? {});
9461
+ return ((type === "tool_use" || type === "server_tool_use" || type === "mcp_tool_use") &&
9462
+ typeof id === "string");
9463
+ }
9464
+ const MAX_REACHED_TOOL_USES = 1000;
9465
+ /**
9466
+ * Records that the consumer reached the tool use `toolUseId`, and whether it
9467
+ * dropped it as output of the work a cancel stopped, then wakes what waits for
9468
+ * it (see `isStoppedWorkToolUse`). The first record of a tool use stays.
9469
+ */
9470
+ function recordReachedToolUse(session, toolUseId, dropped) {
9471
+ const reached = (session.reachedToolUses ??= new Map());
9472
+ if (reached.has(toolUseId))
9473
+ return;
9474
+ reached.set(toolUseId, dropped);
9475
+ if (reached.size > MAX_REACHED_TOOL_USES) {
9476
+ const oldest = reached.keys().next().value;
9477
+ if (oldest !== undefined)
9478
+ reached.delete(oldest);
9479
+ }
9480
+ const waiters = session.toolUseWaiters?.get(toolUseId);
9481
+ if (!waiters)
9482
+ return;
9483
+ session.toolUseWaiters?.delete(toolUseId);
9484
+ for (const wake of waiters)
9485
+ wake();
9486
+ }
9228
9487
  /** Streamed and permission-surfaced tools can precede the SDK's user echo. */
9229
9488
  function recordForegroundToolCall(session, toolCallId) {
9230
9489
  const turn = session.activeTurn ?? session.turnQueue?.find((queued) => !queued.settled);
@@ -121,6 +121,8 @@ export declare class NativeSubagentRuntime {
121
121
  private readonly generationByTaskId;
122
122
  private readonly pending;
123
123
  private pendingCount;
124
+ /** The RFD form: how many times the parent was cancelled (see {@link awaitingUser}). */
125
+ private parentCancels;
124
126
  /**
125
127
  * `form` is undefined for a client without native subagent sessions. The RFD
126
128
  * form restores an agent from before a load or resume with `lineage`.
@@ -179,15 +181,25 @@ export declare class NativeSubagentRuntime {
179
181
  * foreground children that the turn waits on and, currently, background
180
182
  * children too, and the SDK's task events report each as cancelled. A child
181
183
  * that keeps running keeps its open requests
182
- * (agentclientprotocol/agent-client-protocol#2308).
184
+ * (agentclientprotocol/agent-client-protocol#2308). The RFD form only counts
185
+ * the cancel, for {@link awaitingUser}.
183
186
  */
184
187
  parentCancelled(deliver: Publish): Promise<void>;
185
188
  /**
186
189
  * Runs `request`, a permission or question request of the session
187
190
  * `sessionId`. In the RFD form, a child waiting on it is `requires_action`
188
- * until its last open request ends.
191
+ * until its last open request ends, and then `running` again.
192
+ *
193
+ * `signal` aborts when Claude Code withdraws the request, which is not an
194
+ * answer. If the parent was cancelled while the request was open, Claude
195
+ * Code's interrupt withdrew it as it stopped the child, and the SDK's events
196
+ * report the child `idle` next. The end of the request then reports no
197
+ * `running`, which would show a child that is being stopped as working.
198
+ * Without a cancel, something else answered the request in the user's place,
199
+ * such as a `PermissionRequest` hook, and the child runs on, so the end
200
+ * reports `running`.
189
201
  */
190
- awaitingUser<T>(sessionId: string, request: () => Promise<T>): Promise<T>;
202
+ awaitingUser<T>(sessionId: string, request: () => Promise<T>, signal?: AbortSignal): Promise<T>;
191
203
  discardPending(parentToolUseId: string): void;
192
204
  /**
193
205
  * The RFD form: restores the agent `agentId` when the SendMessage call
@@ -1 +1 @@
1
- {"version":3,"file":"native-subagents.d.ts","sourceRoot":"","sources":["../src/native-subagents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAG9F,kFAAkF;AAClF,MAAM,MAAM,SAAS,GAAG,WAAW,CACjC,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,EAAE;IAAE,aAAa,EAAE,iBAAiB,CAAA;CAAE,CAA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pendingCount = 0;
39
+ /** The RFD form: how many times the parent was cancelled (see {@link awaitingUser}). */
40
+ parentCancels = 0;
39
41
  /**
40
42
  * `form` is undefined for a client without native subagent sessions. The RFD
41
43
  * form restores an agent from before a load or resume with `lineage`.
@@ -361,21 +363,34 @@ export class NativeSubagentRuntime {
361
363
  * foreground children that the turn waits on and, currently, background
362
364
  * children too, and the SDK's task events report each as cancelled. A child
363
365
  * that keeps running keeps its open requests
364
- * (agentclientprotocol/agent-client-protocol#2308).
366
+ * (agentclientprotocol/agent-client-protocol#2308). The RFD form only counts
367
+ * the cancel, for {@link awaitingUser}.
365
368
  */
366
369
  async parentCancelled(deliver) {
367
370
  if (this.form === "air")
368
371
  await this.finishAll("cancelled", deliver);
372
+ else
373
+ this.parentCancels++;
369
374
  }
370
375
  /**
371
376
  * Runs `request`, a permission or question request of the session
372
377
  * `sessionId`. In the RFD form, a child waiting on it is `requires_action`
373
- * until its last open request ends.
378
+ * until its last open request ends, and then `running` again.
379
+ *
380
+ * `signal` aborts when Claude Code withdraws the request, which is not an
381
+ * answer. If the parent was cancelled while the request was open, Claude
382
+ * Code's interrupt withdrew it as it stopped the child, and the SDK's events
383
+ * report the child `idle` next. The end of the request then reports no
384
+ * `running`, which would show a child that is being stopped as working.
385
+ * Without a cancel, something else answered the request in the user's place,
386
+ * such as a `PermissionRequest` hook, and the child runs on, so the end
387
+ * reports `running`.
374
388
  */
375
- async awaitingUser(sessionId, request) {
389
+ async awaitingUser(sessionId, request, signal) {
376
390
  const child = this.form === "rfd" ? this.childOfSession(sessionId) : undefined;
377
391
  if (!child?.announced)
378
392
  return request();
393
+ const cancelsAtOpen = this.parentCancels;
379
394
  child.openRequests = (child.openRequests ?? 0) + 1;
380
395
  if (child.openRequests === 1 && child.workState === "running") {
381
396
  await this.reportState(child, { state: "requires_action" }).catch((error) => this.logger.log(`Failed to report that subagent ${child.sessionId} waits: ${error}`));
@@ -385,7 +400,9 @@ export class NativeSubagentRuntime {
385
400
  }
386
401
  finally {
387
402
  child.openRequests = (child.openRequests ?? 1) - 1;
388
- if (child.openRequests === 0 && child.workState === "requires_action") {
403
+ // Withdrawn after a cancel that came while the request was open.
404
+ const stopped = signal?.aborted === true && this.parentCancels !== cancelsAtOpen;
405
+ if (child.openRequests === 0 && child.workState === "requires_action" && !stopped) {
389
406
  await this.reportState(child, { state: "running" }).catch((error) => this.logger.log(`Failed to report that subagent ${child.sessionId} runs: ${error}`));
390
407
  }
391
408
  }
@@ -90,6 +90,11 @@ export declare class AcpToolCallRenderer {
90
90
  * the tool call's content already shows, which it would otherwise keep.
91
91
  */
92
92
  private get keepsMeta();
93
+ /**
94
+ * Whether a tool call with these facts gets a display terminal: a command, for a client
95
+ * that renders terminals.
96
+ */
97
+ private hasTerminal;
93
98
  /**
94
99
  * The status of a tool result. Claude Code reports a run that it aborted in
95
100
  * one of three ways:
@@ -223,13 +228,21 @@ export declare class AcpToolCallRenderer {
223
228
  * client `failed`, since v1 has no `cancelled`. If Claude Code ran it but
224
229
  * returned no result, it failed, unless a `session/cancel` ended the turn
225
230
  * (`cancelled`): the cancel stopped the run, so a v2 client gets `cancelled`
226
- * for it too.
231
+ * for it too. The report does not end the call's terminal: see {@link terminalExit}.
227
232
  */
228
233
  unfinished(call: {
229
234
  toolCallId: string;
230
235
  ran: boolean;
231
236
  cancelled?: boolean;
232
237
  }): ToolCallUpdate;
238
+ /**
239
+ * The `_meta` that ends the display terminal of a command whose tool call gets no result, to
240
+ * add to the report from {@link unfinished}. Undefined when the tool call has no terminal
241
+ * (see {@link toolCall}). The exit code is unknown, since the command ended without a result:
242
+ * null, or 1 for AIR, which always gets a number and reads 1 for a command that did not
243
+ * succeed.
244
+ */
245
+ terminalExit(toolUse: ToolUse): Pick<ToolUpdateMeta, "terminal_exit"> | undefined;
233
246
  /**
234
247
  * The report of a tool progress beat. The field tracker sends the
235
248
  * `in_progress` status once, so a later beat carries only the progress.
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.d.ts","sourceRoot":"","s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,EAAE,MAAM,CAAC;QACjB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,cAAc;IA2BlB;;;;;;;;;OASG;IACH,UAAU,CAAC,IAAI,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,cAAc;IAkB3F;;;;;;OAMG;IACH,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,GAAG,SAAS;IAWjF;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,GAAG,cAAc;IAsBlB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO;IAgBzD;;;;OAIG;IACH,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,eAAe,EAAE;IAS1E;;;;;OAKG;IACH,WAAW,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,cAAc;CAyBtF"}
@@ -49,6 +49,13 @@ export class AcpToolCallRenderer {
49
49
  get keepsMeta() {
50
50
  return this.capabilities.air.client || this.capabilities.v2;
51
51
  }
52
+ /**
53
+ * Whether a tool call with these facts gets a display terminal: a command, for a client
54
+ * that renders terminals.
55
+ */
56
+ hasTerminal(facts) {
57
+ return facts.command === true && this.capabilities.terminalOutput;
58
+ }
52
59
  /**
53
60
  * The status of a tool result. Claude Code reports a run that it aborted in
54
61
  * one of three ways:
@@ -100,9 +107,7 @@ export class AcpToolCallRenderer {
100
107
  return {
101
108
  _meta: {
102
109
  ...this.toolUseMeta(toolUse, options.cwd),
103
- ...(facts.command && this.capabilities.terminalOutput
104
- ? { terminal_info: { terminal_id: toolUse.id } }
105
- : {}),
110
+ ...(this.hasTerminal(facts) ? { terminal_info: { terminal_id: toolUse.id } } : {}),
106
111
  // Only AIR gets the MCP flag. The upstream adapter does not send it.
107
112
  ...(isMcp && this.capabilities.air.client ? { is_mcp_tool_call: true } : {}),
108
113
  },
@@ -462,7 +467,7 @@ export class AcpToolCallRenderer {
462
467
  * client `failed`, since v1 has no `cancelled`. If Claude Code ran it but
463
468
  * returned no result, it failed, unless a `session/cancel` ended the turn
464
469
  * (`cancelled`): the cancel stopped the run, so a v2 client gets `cancelled`
465
- * for it too.
470
+ * for it too. The report does not end the call's terminal: see {@link terminalExit}.
466
471
  */
467
472
  unfinished(call) {
468
473
  const stopped = !call.ran || call.cancelled === true;
@@ -479,6 +484,24 @@ export class AcpToolCallRenderer {
479
484
  ],
480
485
  };
481
486
  }
487
+ /**
488
+ * The `_meta` that ends the display terminal of a command whose tool call gets no result, to
489
+ * add to the report from {@link unfinished}. Undefined when the tool call has no terminal
490
+ * (see {@link toolCall}). The exit code is unknown, since the command ended without a result:
491
+ * null, or 1 for AIR, which always gets a number and reads 1 for a command that did not
492
+ * succeed.
493
+ */
494
+ terminalExit(toolUse) {
495
+ if (!this.hasTerminal(this.facts(toolUse)))
496
+ return undefined;
497
+ return {
498
+ terminal_exit: {
499
+ terminal_id: toolUse.id,
500
+ exit_code: this.capabilities.air.client ? 1 : null,
501
+ signal: null,
502
+ },
503
+ };
504
+ }
482
505
  /**
483
506
  * The report of a tool progress beat. The field tracker sends the
484
507
  * `in_progress` status once, so a later beat carries only the progress.
@@ -529,7 +552,7 @@ export class AcpToolCallRenderer {
529
552
  * does not render `rawInput` itself, and never next to a terminal.
530
553
  */
531
554
  toolUseContent(toolCallId, facts) {
532
- const terminal = facts.command === true && this.capabilities.terminalOutput;
555
+ const terminal = this.hasTerminal(facts);
533
556
  return [
534
557
  ...(terminal ? [{ type: "terminal", terminalId: toolCallId }] : []),
535
558
  ...(facts.change ?? []),
@@ -53,7 +53,11 @@ export interface TurnEvents {
53
53
  * the cycle reports nothing more, and the turn reports from there.
54
54
  */
55
55
  export interface ForegroundEvents {
56
- /** The work started, or works again after it waited for the user. */
56
+ /**
57
+ * The work started, or works again after it waited for the user. Not after
58
+ * a wait that a cancel ended: Claude Code's interrupt withdrew the last
59
+ * request, so the work is being stopped, and {@link ended} follows at once.
60
+ */
57
61
  running(): void;
58
62
  /**
59
63
  * The work waits for the user: a permission request or a question is open in
@@ -1 +1 @@
1
- {"version":3,"file":"turn-events.d.ts","sourceRoot":"","sources":["../src/turn-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC;;;OAGG;IACH,KAAK,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAClC;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,gBAAgB;IAC/B,qEAAqE;IACrE,OAAO,IAAI,IAAI,CAAC;IAChB;;;;OAIG;IACH,YAAY,IAAI,IAAI,CAAC;IACrB,sBAAsB;IACtB,KAAK,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAClC;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9B;AAED,6DAA6D;AAC7D,MAAM,M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YAAY,GAAG,mBAAmB,GAAG,SAAS,GAAG,WAAW,CAAC;AAEnG,wBAAwB;AACxB,MAAM,MAAM,WAAW,GAAG;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC"}
@@ -28,7 +28,8 @@ export declare function v2Prompt(agent: ClaudeAcpAgent, params: v2.PromptRequest
28
28
  *
29
29
  * - Started: `running`. For a prompt's turn, right after its `user_message`.
30
30
  * - Waiting on a permission request or a question: `requires_action`, and
31
- * `running` once none is open.
31
+ * `running` once none is open, unless a cancel withdrew the last one: the
32
+ * work is being stopped then, and its `idle` follows.
32
33
  * - Ended: `idle` with the stop reason, usage, and `_meta` of the work.
33
34
  * - Failed: `idle` with the `error` stop reason and the JSON-RPC error that v1
34
35
  * answers the prompt with, so a client can show its message and handle its
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/v2/prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAIL,KAAK,aAAa,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,0CAA0C,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAuC,MAAM,mBAAmB,CAAC;AAE/F;;;;;;;;;;;GAWG;AACH,wBAAgB,QAA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,aAAa,CAEvF"}
package/dist/v2/prompt.js CHANGED
@@ -57,7 +57,8 @@ export function v2Prompt(agent, params, send) {
57
57
  *
58
58
  * - Started: `running`. For a prompt's turn, right after its `user_message`.
59
59
  * - Waiting on a permission request or a question: `requires_action`, and
60
- * `running` once none is open.
60
+ * `running` once none is open, unless a cancel withdrew the last one: the
61
+ * work is being stopped then, and its `idle` follows.
61
62
  * - Ended: `idle` with the stop reason, usage, and `_meta` of the work.
62
63
  * - Failed: `idle` with the `error` stop reason and the JSON-RPC error that v1
63
64
  * answers the prompt with, so a client can show its message and handle its
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.90.1-preview.1",
6
+ "version": "0.90.1-preview.10",
7
7
  "description": "An ACP-compatible coding agent powered by the Claude Agent SDK (TypeScript)",
8
8
  "main": "dist/lib.js",
9
9
  "types": "dist/lib.d.ts",