@agentclientprotocol/claude-agent-acp 0.61.0 → 0.63.0

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
@@ -12,12 +12,24 @@ This tool implements an ACP agent by using the official [Claude Agent SDK](https
12
12
  - Following
13
13
  - Edit review
14
14
  - TODO lists
15
+ - Nested subagent transcripts
15
16
  - Interactive (and background) terminals
16
17
  - Custom [Slash commands](https://docs.anthropic.com/en/docs/claude-code/slash-commands)
17
18
  - Client MCP servers
18
19
 
19
20
  Learn more about the [Agent Client Protocol](https://agentclientprotocol.com/).
20
21
 
22
+ ### Nested subagent transcripts
23
+
24
+ ACP 1.2 has no standard subagent tool kind or nested-message relationship. Clients that can render
25
+ nested transcripts can opt in with `clientCapabilities._meta["subagent-transcript"] = true`.
26
+ The agent then forwards subagent text, thinking, and tool calls, relating nested updates to the
27
+ launching Agent/Task call through `_meta.claudeCode.parentToolUseId`. Agent/Task calls are marked
28
+ with `_meta.claudeCode.subagent = true`.
29
+
30
+ Clients that do not advertise the capability retain the legacy flattened behavior. In both modes,
31
+ the normal Agent/Task tool result is preserved as the protocol-compatible fallback.
32
+
21
33
  ## Contribution Policy
22
34
 
23
35
  This project does not require a Contributor License Agreement (CLA). Instead, contributions are accepted under the following terms:
@@ -1,5 +1,5 @@
1
1
  import { AuthenticateRequest, CancelNotification, ClientCapabilities, CompleteElicitationNotification, CreateElicitationRequest, CreateElicitationResponse, DisableProviderRequest, DisableProviderResponse, ForkSessionRequest, ForkSessionResponse, InitializeRequest, InitializeResponse, ListProvidersRequest, ListProvidersResponse, LlmProtocol, ListSessionsRequest, ListSessionsResponse, LoadSessionRequest, LoadSessionResponse, LogoutRequest, NewSessionRequest, NewSessionResponse, PromptRequest, PromptResponse, ReadTextFileRequest, ReadTextFileResponse, SetProviderRequest, SetProviderResponse, RequestPermissionRequest, RequestPermissionResponse, ResumeSessionRequest, ResumeSessionResponse, SessionConfigOption, SessionModeState, SessionNotification, SetSessionConfigOptionRequest, SetSessionConfigOptionResponse, SetSessionModeRequest, SetSessionModeResponse, CloseSessionRequest, CloseSessionResponse, DeleteSessionRequest, DeleteSessionResponse, WriteTextFileRequest, WriteTextFileResponse } from "@agentclientprotocol/sdk";
2
- import { AgentInfo, CanUseTool, FastModeState, ModelInfo, Options, PermissionMode, PermissionUpdate, Query, SDKMessageOrigin, SDKPartialAssistantMessage, SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
2
+ import { AgentInfo, CanUseTool, FastModeDisabledReason, FastModeState, ModelInfo, Options, PermissionMode, PermissionUpdate, Query, SDKMessageOrigin, SDKPartialAssistantMessage, SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
3
3
  import { ContentBlockParam } from "@anthropic-ai/sdk/resources";
4
4
  import { BetaContentBlock, BetaRawContentBlockDelta } from "@anthropic-ai/sdk/resources/beta.mjs";
5
5
  import { SettingsManager } from "./settings.js";
@@ -229,6 +229,13 @@ type Session = {
229
229
  * user's intent so it persists across model switches; the Fast mode config
230
230
  * option is only surfaced while the selected model supports it. */
231
231
  fastModeEnabled: boolean;
232
+ /** Why the SDK currently can't serve Fast mode, when the reason is one worth
233
+ * telling the user about (see {@link FAST_MODE_UNAVAILABLE_EXPLANATIONS} —
234
+ * routine states like the SDK's own opt-in requirement normalize to
235
+ * `undefined`). Refreshed from every `fast_mode_disabled_reason` the SDK
236
+ * reports on `system`/init and user-turn `result`s; surfaced in the Fast mode
237
+ * option's description so a toggle that snaps back off explains itself. */
238
+ fastModeDisabledReason?: FastModeDisabledReason;
232
239
  abortController: AbortController;
233
240
  /** Signal the consumer races `query.next()` against. Aborted by cancel()
234
241
  * (after a grace period) to force the active turn to settle "cancelled" when
@@ -242,6 +249,9 @@ type Session = {
242
249
  * cancel. */
243
250
  forceCancelTimer?: ReturnType<typeof setTimeout>;
244
251
  emitRawSDKMessages: boolean | SDKMessageFilter[];
252
+ /** Whether nested subagent text/thinking is forwarded to the ACP client.
253
+ * Enabled by either the ACP capability or the pre-existing SDK option. */
254
+ forwardSubagentText: boolean;
245
255
  /** Context window size of the session's current model, carried across
246
256
  * prompts so mid-stream usage_update notifications report a correct `size`
247
257
  * before the turn's first result message arrives. Seeded synchronously at
@@ -496,10 +506,12 @@ type ProviderConfig = {
496
506
  export type ToolUpdateMeta = {
497
507
  claudeCode?: {
498
508
  toolName: string;
509
+ title?: string;
499
510
  toolResponse?: unknown;
500
511
  parentToolUseId?: string;
501
512
  nonExecutionKind?: string;
502
513
  userFeedback?: string;
514
+ subagent?: true;
503
515
  };
504
516
  terminal_info?: {
505
517
  terminal_id: string;
@@ -819,7 +831,14 @@ export declare class ClaudeAcpAgent {
819
831
  * here).
820
832
  * - `cooldown`: a transient suspension of an already-enabled fast mode.
821
833
  * Leave the toggle as-is rather than flapping it — and never let a stray
822
- * cooldown spuriously enable a toggle the user has off. */
834
+ * cooldown spuriously enable a toggle the user has off.
835
+ *
836
+ * `reason` is the SDK's `fast_mode_disabled_reason`, reported alongside the
837
+ * state. Only explainable reasons are retained (see
838
+ * {@link normalizeFastModeDisabledReason}), so the comparison below tracks
839
+ * exactly what the user can see: a routine `sdk_opt_in_required` report on
840
+ * every turn's result can't churn the option, while a real blocker updates
841
+ * the description even when the toggle's own value is unchanged. */
823
842
  private syncFastModeState;
824
843
  private getOrCreateSession;
825
844
  /**
@@ -856,6 +875,12 @@ export declare const FAST_MODE_OFF = "off";
856
875
  * docs) keeps the toggle on so it reflects the user's intent — only an
857
876
  * explicit `off` clears it. */
858
877
  export declare function fastModeStateEnabled(state: FastModeState): boolean;
878
+ /** Normalize an SDK-reported `fast_mode_disabled_reason` to the one we retain:
879
+ * a reason we have an explanation for, else `undefined`. Keeping only
880
+ * explainable reasons means state comparisons (see `syncFastModeState`) track
881
+ * exactly what the user can see, so routine reports like
882
+ * `sdk_opt_in_required` never churn the config option. */
883
+ export declare function normalizeFastModeDisabledReason(reason: FastModeDisabledReason | undefined): FastModeDisabledReason | undefined;
859
884
  /** Whether the Client advertised support for boolean session config options
860
885
  * (`session.configOptions.boolean`). Agents MUST only send `type: "boolean"`
861
886
  * config options to Clients that opt in; otherwise we fall back to a `select`.
@@ -864,8 +889,14 @@ export declare function clientSupportsBooleanConfigOptions(clientCapabilities?:
864
889
  /** Build the Fast mode config option. When the Client supports boolean config
865
890
  * options we expose a native `type: "boolean"` toggle; otherwise we degrade to
866
891
  * a two-value `select` ("on"/"off") so older Clients still get a usable
867
- * control. */
868
- export declare function createFastModeConfigOption(enabled: boolean, useBooleanOption: boolean): SessionConfigOption;
892
+ * control.
893
+ *
894
+ * `disabledReason` (the SDK's `fast_mode_disabled_reason`) is folded into the
895
+ * description while the toggle reads off, so a user whose account or provider
896
+ * can't serve Fast mode sees why instead of a switch that silently refuses to
897
+ * stay on. Ignored while enabled: a reason reported alongside an `on`/`cooldown`
898
+ * state isn't blocking anything right now. */
899
+ export declare function createFastModeConfigOption(enabled: boolean, useBooleanOption: boolean, disabledReason?: FastModeDisabledReason): SessionConfigOption;
869
900
  /** Resolve the requested Fast mode value from a `session/set_config_option`
870
901
  * request. Accepts a native boolean (boolean-capable Clients) or the
871
902
  * "on"/"off" select-fallback strings. */
@@ -877,6 +908,9 @@ export type FastModeOptionState = {
877
908
  enabled: boolean;
878
909
  /** Whether the Client opted into boolean config options. */
879
910
  useBooleanOption: boolean;
911
+ /** Latest explainable `fast_mode_disabled_reason`, folded into the option's
912
+ * description while the toggle reads off. */
913
+ disabledReason?: FastModeDisabledReason;
880
914
  };
881
915
  export declare function buildConfigOptions(modes: SessionModeState, models: SessionModelState, modelInfos: ModelInfo[], currentEffortLevel?: string, agents?: AgentInfo[], currentAgent?: string, fastMode?: FastModeOptionState): SessionConfigOption[];
882
916
  export declare function resolveModelPreference(models: ModelInfo[], preference: string): ModelInfo | null;
@@ -1 +1 @@
1
- {"version":3,"file":"acp-agent.d.ts","sourceRoot":"","sources":["../src/acp-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,mBAAmB,EAGnB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AE,MAAM,EACd,OAAO,CAAC,EAAE;IACR,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,sBAAsB,CAAC;CAC7C,GACA,mBAAmB,EAAE,CAgIvB;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,wBAAgB,MAAM;;;EA2CrB"}
package/dist/acp-agent.js CHANGED
@@ -140,6 +140,23 @@ const PROVIDER_ID = "main";
140
140
  * env-var mappings understood by {@link createEnvForProvider}.
141
141
  */
142
142
  const SUPPORTED_PROTOCOLS = ["anthropic", "bedrock", "vertex"];
143
+ const SUBAGENT_TRANSCRIPT_CAPABILITY = "subagent-transcript";
144
+ function supportsSubagentTranscript(capabilities) {
145
+ return capabilities?._meta?.[SUBAGENT_TRANSCRIPT_CAPABILITY] === true;
146
+ }
147
+ function parentToolUseIdOf(message) {
148
+ if (!("parent_tool_use_id" in message))
149
+ return null;
150
+ return typeof message.parent_tool_use_id === "string" ? message.parent_tool_use_id : null;
151
+ }
152
+ function stripSubagentTextAndThinking(content) {
153
+ if (!Array.isArray(content))
154
+ return content;
155
+ return content.filter((item) => !item ||
156
+ typeof item !== "object" ||
157
+ !("type" in item) ||
158
+ (item.type !== "text" && item.type !== "thinking"));
159
+ }
143
160
  /**
144
161
  * Advance the lexer state across the fragment appended since the last delta:
145
162
  * just enough JSON awareness (string/escape, nesting depth) to spot commas
@@ -1583,7 +1600,7 @@ export class ClaudeAcpAgent {
1583
1600
  // A fresh `system`/init (e.g. after reinitialize) can carry an
1584
1601
  // updated Fast mode state; reconcile it with what we seeded at
1585
1602
  // session creation.
1586
- await this.syncFastModeState(message.session_id, session, message.fast_mode_state);
1603
+ await this.syncFastModeState(message.session_id, session, message.fast_mode_state, message.fast_mode_disabled_reason);
1587
1604
  break;
1588
1605
  case "status": {
1589
1606
  // These banners count as delivered text (via sendUpdate), so
@@ -1828,6 +1845,28 @@ export class ClaudeAcpAgent {
1828
1845
  // already emitted as a `tool_call`, so mark it failed with the
1829
1846
  // rejection reason — otherwise the client shows a tool call
1830
1847
  // that silently never resolves.
1848
+ //
1849
+ // The id is the executing call's own, and the frame lands
1850
+ // between its `tool_use` and its `tool_result` (the SDK enqueues
1851
+ // it from inside canUseTool), so the call is normally in flight
1852
+ // here. Not always: the assistant message carrying the tool_use
1853
+ // is dropped by the cancelled-turn guard below, and a denial for
1854
+ // it can still arrive afterwards — the case the `tool_result`
1855
+ // fallback in `toAcpNotifications` gates on `wasEmitted` for.
1856
+ // Drop the update rather than reference a tool call the client
1857
+ // was never given (see `ensureToolCallEmitted`, issue #851).
1858
+ if (!session.emittedToolCalls.has(message.tool_use_id)) {
1859
+ break;
1860
+ }
1861
+ // A denial inside a subagent identifies the subagent by
1862
+ // `agent_id` (as canUseTool does with `agentID`), never by the
1863
+ // Agent/Task call that spawned it. Resolve it the same way so
1864
+ // the update lands in the subagent's transcript alongside the
1865
+ // `tool_call` it resolves, which carries the parent stamped from
1866
+ // `parent_tool_use_id` (see `liveBackgroundTasks`).
1867
+ const parentToolUseId = message.agent_id
1868
+ ? session.liveBackgroundTasks.get(message.agent_id)?.parentToolUseId
1869
+ : undefined;
1831
1870
  const reason = message.decision_reason ?? message.message;
1832
1871
  await sendUpdate({
1833
1872
  sessionId: message.session_id,
@@ -1844,6 +1883,7 @@ export class ClaudeAcpAgent {
1844
1883
  _meta: {
1845
1884
  claudeCode: {
1846
1885
  toolName: message.tool_name,
1886
+ ...(parentToolUseId ? { parentToolUseId } : {}),
1847
1887
  toolResponse: {
1848
1888
  decisionReasonType: message.decision_reason_type,
1849
1889
  decisionReason: message.decision_reason,
@@ -2077,7 +2117,7 @@ export class ClaudeAcpAgent {
2077
2117
  // an autonomous cycle's state lands on the next user turn's
2078
2118
  // result. Runs even when the turn errors or was cancelled.
2079
2119
  if (!isAutonomousResult) {
2080
- await this.syncFastModeState(params.sessionId, session, message.fast_mode_state);
2120
+ await this.syncFastModeState(params.sessionId, session, message.fast_mode_state, message.fast_mode_disabled_reason);
2081
2121
  }
2082
2122
  // A user-turn result needs an active turn so its stop reason is
2083
2123
  // attributed and the turn settles at idle. Local-only commands carry
@@ -2691,11 +2731,13 @@ export class ClaudeAcpAgent {
2691
2731
  // the record stays bounded to the in-flight message.
2692
2732
  streamedBlocks.length = 0;
2693
2733
  }
2694
- else if (message.type === "assistant") {
2695
- // Subagent assistant message (`parent_tool_use_id !== null`). It is
2696
- // never streamed live and its text/thinking is internal to the tool
2697
- // call — keep dropping it so subagent prose doesn't leak into the
2698
- // top-level feed.
2734
+ else if (message.type === "assistant" &&
2735
+ !(session.forwardSubagentText || supportsSubagentTranscript(this.clientCapabilities))) {
2736
+ // Legacy clients don't understand nested transcripts. Keep the
2737
+ // historical behavior for them: subagent text/thinking remains
2738
+ // internal to the tool call instead of leaking into the top-level
2739
+ // feed. Capable clients opt into the branch above unchanged, with
2740
+ // `parentToolUseId` stamped by toAcpNotifications.
2699
2741
  content = message.message.content.filter((item) => item.type !== "text" && item.type !== "thinking");
2700
2742
  }
2701
2743
  else {
@@ -2724,11 +2766,30 @@ export class ClaudeAcpAgent {
2724
2766
  break;
2725
2767
  }
2726
2768
  case "tool_progress": {
2769
+ // Not every beat reports under the id of a tool call the client has
2770
+ // seen: heartbeats derive `<tool_use_id>-heartbeat-<n>`, and the
2771
+ // `agent_api_retry` beats behind `subagentRetry` report under
2772
+ // `agent_<assistant_message_id>`. Forwarding those verbatim leaves the
2773
+ // client resolving an id it has never been told about (the same trap
2774
+ // `ensureToolCallEmitted` documents for #851). The SDK stamps
2775
+ // `parent_tool_use_id` with the executing tool's real id whenever the
2776
+ // beat doesn't carry one of its own, so fall back to it rather than
2777
+ // pattern-matching each synthetic id shape. Beats that do report a real
2778
+ // id (a subagent's `bash_progress`, whose parent is the spawning Agent
2779
+ // call) keep resolving to that id.
2780
+ const toolCallId = session.emittedToolCalls.has(message.tool_use_id)
2781
+ ? message.tool_use_id
2782
+ : message.parent_tool_use_id;
2783
+ // Ids leave `emittedToolCalls` at `tool_result`, so this also stops a
2784
+ // beat that races past completion from reopening a finished call.
2785
+ if (toolCallId === null || !session.emittedToolCalls.has(toolCallId)) {
2786
+ break;
2787
+ }
2727
2788
  await sendUpdate({
2728
2789
  sessionId: message.session_id,
2729
2790
  update: {
2730
2791
  sessionUpdate: "tool_call_update",
2731
- toolCallId: message.tool_use_id,
2792
+ toolCallId,
2732
2793
  status: "in_progress",
2733
2794
  _meta: {
2734
2795
  claudeCode: {
@@ -3239,6 +3300,8 @@ export class ClaudeAcpAgent {
3239
3300
  async replaySessionHistory(sessionId) {
3240
3301
  const toolUseCache = {};
3241
3302
  const messages = await getSessionMessages(sessionId);
3303
+ const forwardSubagentText = this.sessions[sessionId]?.forwardSubagentText ??
3304
+ supportsSubagentTranscript(this.clientCapabilities);
3242
3305
  for (const message of messages) {
3243
3306
  // Backfill the ACP messageId -> SDK uuid mapping for messages we didn't
3244
3307
  // observe live (resumed/loaded sessions), so rewind/resume can translate
@@ -3257,6 +3320,10 @@ export class ClaudeAcpAgent {
3257
3320
  }
3258
3321
  // @ts-expect-error - untyped in SDK but we handle all of these
3259
3322
  let content = message.message.content;
3323
+ const parentToolUseId = parentToolUseIdOf(message);
3324
+ if (message.type === "assistant" && parentToolUseId && !forwardSubagentText) {
3325
+ content = stripSubagentTextAndThinking(content);
3326
+ }
3260
3327
  // @ts-expect-error - untyped in SDK but we handle all of these
3261
3328
  if (message.message.role === "user") {
3262
3329
  content = stripLocalCommandMetadata(content);
@@ -3273,6 +3340,7 @@ export class ClaudeAcpAgent {
3273
3340
  cwd: this.sessions[sessionId]?.cwd,
3274
3341
  taskState: this.sessions[sessionId]?.taskState,
3275
3342
  messageId: replayMessageId,
3343
+ parentToolUseId,
3276
3344
  })) {
3277
3345
  await this.client.sessionUpdate(notification);
3278
3346
  }
@@ -3719,6 +3787,13 @@ export class ClaudeAcpAgent {
3719
3787
  else {
3720
3788
  session.modes = { ...session.modes, availableModes: newAvailableModes };
3721
3789
  }
3790
+ // `model_not_allowed` described the model we just left, so it must not
3791
+ // follow us onto the new one; the remaining reasons are account- or
3792
+ // environment-scoped and stay true across a switch. Either way the next
3793
+ // init/result report refreshes this.
3794
+ if (session.fastModeDisabledReason === "model_not_allowed") {
3795
+ session.fastModeDisabledReason = undefined;
3796
+ }
3722
3797
  // Rebuild config options since effort levels depend on the selected model
3723
3798
  const effortOpt = session.configOptions.find((o) => o.id === EFFORT_CONFIG_ID);
3724
3799
  const currentEffort = typeof effortOpt?.currentValue === "string" ? effortOpt.currentValue : undefined;
@@ -3729,6 +3804,7 @@ export class ClaudeAcpAgent {
3729
3804
  supported: newModelInfo?.supportsFastMode ?? false,
3730
3805
  enabled: session.fastModeEnabled,
3731
3806
  useBooleanOption: clientSupportsBooleanConfigOptions(this.clientCapabilities),
3807
+ disabledReason: session.fastModeDisabledReason,
3732
3808
  });
3733
3809
  // Sync effort with the SDK if it changed after the model switch
3734
3810
  const newEffortOpt = session.configOptions.find((o) => o.id === EFFORT_CONFIG_ID);
@@ -3810,7 +3886,7 @@ export class ClaudeAcpAgent {
3810
3886
  * option isn't present, so callers must confirm the current model surfaces
3811
3887
  * it first. */
3812
3888
  refreshFastModeOption(session, enabled) {
3813
- const refreshed = createFastModeConfigOption(enabled, clientSupportsBooleanConfigOptions(this.clientCapabilities));
3889
+ const refreshed = createFastModeConfigOption(enabled, clientSupportsBooleanConfigOptions(this.clientCapabilities), session.fastModeDisabledReason);
3814
3890
  session.configOptions = session.configOptions.map((o) => o.id === FAST_MODE_CONFIG_ID ? refreshed : o);
3815
3891
  }
3816
3892
  /** Toggle Fast mode for a session: push the SDK flag, record the user's
@@ -3839,8 +3915,15 @@ export class ClaudeAcpAgent {
3839
3915
  * here).
3840
3916
  * - `cooldown`: a transient suspension of an already-enabled fast mode.
3841
3917
  * Leave the toggle as-is rather than flapping it — and never let a stray
3842
- * cooldown spuriously enable a toggle the user has off. */
3843
- async syncFastModeState(sessionId, session, state) {
3918
+ * cooldown spuriously enable a toggle the user has off.
3919
+ *
3920
+ * `reason` is the SDK's `fast_mode_disabled_reason`, reported alongside the
3921
+ * state. Only explainable reasons are retained (see
3922
+ * {@link normalizeFastModeDisabledReason}), so the comparison below tracks
3923
+ * exactly what the user can see: a routine `sdk_opt_in_required` report on
3924
+ * every turn's result can't churn the option, while a real blocker updates
3925
+ * the description even when the toggle's own value is unchanged. */
3926
+ async syncFastModeState(sessionId, session, state, reason) {
3844
3927
  if (state === undefined) {
3845
3928
  return;
3846
3929
  }
@@ -3851,11 +3934,31 @@ export class ClaudeAcpAgent {
3851
3934
  return;
3852
3935
  }
3853
3936
  const enabled = state === "on";
3854
- if (enabled === session.fastModeEnabled) {
3937
+ // A reason only describes an off state; drop any that rides an `on` report
3938
+ // so it can't decorate the option the next time fast mode goes off.
3939
+ const nextReason = enabled ? undefined : normalizeFastModeDisabledReason(reason);
3940
+ if (enabled === session.fastModeEnabled && nextReason === session.fastModeDisabledReason) {
3855
3941
  return;
3856
3942
  }
3943
+ // The user asked for Fast mode and the SDK is telling us it can't serve it.
3944
+ // The description carries the same explanation, but a toggle silently
3945
+ // snapping back is the case worth saying out loud once, at the flip.
3946
+ const explain = session.fastModeEnabled && !enabled && nextReason !== undefined;
3857
3947
  session.fastModeEnabled = enabled;
3948
+ session.fastModeDisabledReason = nextReason;
3858
3949
  this.refreshFastModeOption(session, enabled);
3950
+ if (explain) {
3951
+ await this.client.sessionUpdate({
3952
+ sessionId,
3953
+ update: {
3954
+ sessionUpdate: "agent_message_chunk",
3955
+ content: {
3956
+ type: "text",
3957
+ text: `**Fast mode turned off:** ${FAST_MODE_UNAVAILABLE_EXPLANATIONS[nextReason]}.`,
3958
+ },
3959
+ },
3960
+ });
3961
+ }
3859
3962
  await this.client.sessionUpdate({
3860
3963
  sessionId,
3861
3964
  update: {
@@ -3987,6 +4090,8 @@ export class ClaudeAcpAgent {
3987
4090
  // Extract options from _meta if provided
3988
4091
  const sessionMeta = params._meta;
3989
4092
  const userProvidedOptions = sessionMeta?.claudeCode?.options;
4093
+ const forwardSubagentText = supportsSubagentTranscript(this.clientCapabilities) ||
4094
+ userProvidedOptions?.forwardSubagentText === true;
3990
4095
  // Configure thinking behavior from environment variable
3991
4096
  const thinking = resolveThinkingConfig(process.env.MAX_THINKING_TOKENS, this.logger);
3992
4097
  // Parse model configuration from environment (e.g. Bedrock model overrides)
@@ -4055,6 +4160,7 @@ export class ClaudeAcpAgent {
4055
4160
  // Override certain fields that must be controlled by ACP
4056
4161
  cwd: params.cwd,
4057
4162
  includePartialMessages: true,
4163
+ forwardSubagentText,
4058
4164
  mcpServers: { ...(userProvidedOptions?.mcpServers || {}), ...mcpServers },
4059
4165
  // If we want bypassPermissions to be an option, we have to allow it here.
4060
4166
  // But it doesn't work in root mode, so we only activate it if it will work.
@@ -4283,10 +4389,18 @@ export class ClaudeAcpAgent {
4283
4389
  // the resolved model advertises `supportsFastMode`.
4284
4390
  const fastModeEnabled = initializationResult.fast_mode_state !== undefined &&
4285
4391
  fastModeStateEnabled(initializationResult.fast_mode_state);
4392
+ // `fast_mode_disabled_reason` reflects the post-switch model since SDK
4393
+ // 0.3.219 (the initialize response used to answer from the spawn-time
4394
+ // model). A fresh SDK session reports `sdk_opt_in_required` — the toggle IS
4395
+ // the opt-in — which normalizes away, so only real blockers are retained.
4396
+ const fastModeDisabledReason = fastModeEnabled
4397
+ ? undefined
4398
+ : normalizeFastModeDisabledReason(initializationResult.fast_mode_disabled_reason);
4286
4399
  const fastMode = {
4287
4400
  supported: currentModelInfo?.supportsFastMode ?? false,
4288
4401
  enabled: fastModeEnabled,
4289
4402
  useBooleanOption: clientSupportsBooleanConfigOptions(this.clientCapabilities),
4403
+ disabledReason: fastModeDisabledReason,
4290
4404
  };
4291
4405
  const configOptions = buildConfigOptions(modes, models, modelInfos, settingsManager.getSettings().effortLevel, agents, currentAgent, fastMode);
4292
4406
  // Apply the initial effort level to the SDK so it matches the UI default
@@ -4348,8 +4462,10 @@ export class ClaudeAcpAgent {
4348
4462
  agents,
4349
4463
  currentAgent,
4350
4464
  fastModeEnabled,
4465
+ fastModeDisabledReason,
4351
4466
  abortController,
4352
4467
  emitRawSDKMessages: sessionMeta?.claudeCode?.emitRawSDKMessages ?? false,
4468
+ forwardSubagentText,
4353
4469
  contextWindowSize: seededWindow.size,
4354
4470
  contextWindowAuthoritative: seededWindow.authoritative,
4355
4471
  providerCacheKey,
@@ -4607,6 +4723,32 @@ const FAST_MODE_DESCRIPTION = "Faster responses on supported models";
4607
4723
  export function fastModeStateEnabled(state) {
4608
4724
  return state !== "off";
4609
4725
  }
4726
+ /** User-facing explanations for the SDK's `fast_mode_disabled_reason` values
4727
+ * that a user can act on (or at least wants to know about). Deliberately
4728
+ * partial — the omitted reasons are not worth surfacing:
4729
+ * - `sdk_opt_in_required`: every SDK session starts here (the toggle IS the
4730
+ * opt-in), so it describes the default, not a problem.
4731
+ * - `preference`: the user turned Fast mode off themselves.
4732
+ * - `pending`: eligibility is still resolving; the next report supersedes it.
4733
+ * - `unknown`: nothing meaningful to say.
4734
+ * Unknown future reasons fall through the same way (open set — the SDK's docs
4735
+ * say to ignore values you don't handle). */
4736
+ const FAST_MODE_UNAVAILABLE_EXPLANATIONS = {
4737
+ free: "not available on the free plan",
4738
+ extra_usage_disabled: "requires extra usage to be enabled for this account",
4739
+ model_not_allowed: "not available for the selected model",
4740
+ not_first_party: "not available on this API provider",
4741
+ disabled_by_env: "disabled by environment configuration",
4742
+ network_error: "eligibility could not be verified (network error)",
4743
+ };
4744
+ /** Normalize an SDK-reported `fast_mode_disabled_reason` to the one we retain:
4745
+ * a reason we have an explanation for, else `undefined`. Keeping only
4746
+ * explainable reasons means state comparisons (see `syncFastModeState`) track
4747
+ * exactly what the user can see, so routine reports like
4748
+ * `sdk_opt_in_required` never churn the config option. */
4749
+ export function normalizeFastModeDisabledReason(reason) {
4750
+ return reason && FAST_MODE_UNAVAILABLE_EXPLANATIONS[reason] ? reason : undefined;
4751
+ }
4610
4752
  /** Whether the Client advertised support for boolean session config options
4611
4753
  * (`session.configOptions.boolean`). Agents MUST only send `type: "boolean"`
4612
4754
  * config options to Clients that opt in; otherwise we fall back to a `select`.
@@ -4617,12 +4759,21 @@ export function clientSupportsBooleanConfigOptions(clientCapabilities) {
4617
4759
  /** Build the Fast mode config option. When the Client supports boolean config
4618
4760
  * options we expose a native `type: "boolean"` toggle; otherwise we degrade to
4619
4761
  * a two-value `select` ("on"/"off") so older Clients still get a usable
4620
- * control. */
4621
- export function createFastModeConfigOption(enabled, useBooleanOption) {
4762
+ * control.
4763
+ *
4764
+ * `disabledReason` (the SDK's `fast_mode_disabled_reason`) is folded into the
4765
+ * description while the toggle reads off, so a user whose account or provider
4766
+ * can't serve Fast mode sees why instead of a switch that silently refuses to
4767
+ * stay on. Ignored while enabled: a reason reported alongside an `on`/`cooldown`
4768
+ * state isn't blocking anything right now. */
4769
+ export function createFastModeConfigOption(enabled, useBooleanOption, disabledReason) {
4770
+ const explanation = enabled
4771
+ ? undefined
4772
+ : disabledReason && FAST_MODE_UNAVAILABLE_EXPLANATIONS[disabledReason];
4622
4773
  const base = {
4623
4774
  id: FAST_MODE_CONFIG_ID,
4624
4775
  name: "Fast mode",
4625
- description: FAST_MODE_DESCRIPTION,
4776
+ description: explanation ? `${FAST_MODE_DESCRIPTION} — ${explanation}` : FAST_MODE_DESCRIPTION,
4626
4777
  category: "model_config",
4627
4778
  };
4628
4779
  if (useBooleanOption) {
@@ -4715,7 +4866,7 @@ export function buildConfigOptions(modes, models, modelInfos, currentEffortLevel
4715
4866
  // option renders as a native boolean toggle for Clients that opted in, and a
4716
4867
  // two-value select otherwise.
4717
4868
  if (fastMode?.supported) {
4718
- options.push(createFastModeConfigOption(fastMode.enabled, fastMode.useBooleanOption));
4869
+ options.push(createFastModeConfigOption(fastMode.enabled, fastMode.useBooleanOption, fastMode.disabledReason));
4719
4870
  }
4720
4871
  // Only surface the Agent picker when there's a real choice — i.e. the user
4721
4872
  // has configured at least one custom agent (built-ins are filtered out in
@@ -5298,6 +5449,24 @@ function isTaskTool(toolName) {
5298
5449
  function shouldEmitToolCall(toolName) {
5299
5450
  return toolName !== "TodoWrite" && !isTaskTool(toolName);
5300
5451
  }
5452
+ /** Build the Claude Code-specific metadata for a tool call. Bash descriptions
5453
+ * are kept out of ACP's standard `title`, which clients may use as the shell
5454
+ * command preview, while still giving clients access to Claude's concise
5455
+ * human-readable title. */
5456
+ function claudeCodeMetaFromToolUse(toolUse) {
5457
+ const description = toolUse.name === "Bash" &&
5458
+ toolUse.input !== null &&
5459
+ typeof toolUse.input === "object" &&
5460
+ "description" in toolUse.input &&
5461
+ typeof toolUse.input.description === "string"
5462
+ ? toolUse.input.description
5463
+ : undefined;
5464
+ return {
5465
+ toolName: toolUse.name,
5466
+ ...(description ? { title: description } : {}),
5467
+ ...((toolUse.name === "Agent" || toolUse.name === "Task") && { subagent: true }),
5468
+ };
5469
+ }
5301
5470
  /** Build the `tool_call` (or, with `refine`, the `tool_call_update`)
5302
5471
  * notification for a tool_use. Shared by every site that surfaces a tool call:
5303
5472
  * the streamed tool_use path (first encounter → tool_call, later encounter →
@@ -5308,7 +5477,7 @@ function shouldEmitToolCall(toolName) {
5308
5477
  function toolCallNotification(toolUse, rawInput, supportsTerminalOutput, cwd, refine = false) {
5309
5478
  if (refine) {
5310
5479
  return {
5311
- _meta: { claudeCode: { toolName: toolUse.name } },
5480
+ _meta: { claudeCode: claudeCodeMetaFromToolUse(toolUse) },
5312
5481
  toolCallId: toolUse.id,
5313
5482
  sessionUpdate: "tool_call_update",
5314
5483
  rawInput,
@@ -5317,7 +5486,7 @@ function toolCallNotification(toolUse, rawInput, supportsTerminalOutput, cwd, re
5317
5486
  }
5318
5487
  return {
5319
5488
  _meta: {
5320
- claudeCode: { toolName: toolUse.name },
5489
+ claudeCode: claudeCodeMetaFromToolUse(toolUse),
5321
5490
  ...(toolUse.name === "Bash" && supportsTerminalOutput
5322
5491
  ? { terminal_info: { terminal_id: toolUse.id } }
5323
5492
  : {}),
@@ -5342,7 +5511,9 @@ function streamedInputRefinement(toolUse, input, supportsTerminalOutput, cwd) {
5342
5511
  }
5343
5512
  const { title, kind, locations } = toolInfoFromToolUse({ ...toolUse, input }, supportsTerminalOutput, cwd);
5344
5513
  return {
5345
- _meta: { claudeCode: { toolName: toolUse.name } },
5514
+ _meta: {
5515
+ claudeCode: claudeCodeMetaFromToolUse({ ...toolUse, input }),
5516
+ },
5346
5517
  toolCallId: toolUse.id,
5347
5518
  sessionUpdate: "tool_call_update",
5348
5519
  rawInput: input,
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACT,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAaL,eAAe,EACf,gBAAgB,EAChB,eAAe,EAKhB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAGL,oBAAoB,EAEpB,6BAA6B,EAE9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,yCAAyC,EAGzC,qCAAqC,EAGrC,kCAAkC,EAGlC,+CAA+C,EAI/C,wBAAwB,EACxB,kCAAkC,EAIlC,gCAAgC,EAEhC,iCAAiC,EAClC,MAAM,sCAAsC,CAAC;AA2B9C,UAAU,QAAQ;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAA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AAC,IAAI,CAAC,CAAA;CAAE,KAAG,YAsBpE,CAAC"}
package/dist/tools.js CHANGED
@@ -501,7 +501,17 @@ export function toolUpdateFromToolResult(toolResult, toolUse, supportsTerminalOu
501
501
  }
502
502
  case "Bash": {
503
503
  const result = toolResult.content;
504
- const terminalId = "tool_use_id" in toolResult ? String(toolResult.tool_use_id) : "";
504
+ // The terminal was announced under the tool_use's own id (see
505
+ // `toolInfoFromToolUse`), so key the output/exit metas off that: it is the
506
+ // id the client actually created a terminal for. `toolResult.tool_use_id`
507
+ // is the same value whenever present — the caller looks the tool_use up by
508
+ // it — so preferring `toolUse.id` only adds a source for the case where the
509
+ // result block carries no id at all. Anything that isn't a non-empty
510
+ // string is no id at all: `""` matches no terminal, and stringifying a
511
+ // present-but-undefined field would invent the literal `"undefined"`.
512
+ const terminalIdOf = (id) => typeof id === "string" && id.length > 0 ? id : undefined;
513
+ const terminalId = terminalIdOf(toolUse?.id) ??
514
+ terminalIdOf("tool_use_id" in toolResult ? toolResult.tool_use_id : undefined);
505
515
  const isError = "is_error" in toolResult && toolResult.is_error;
506
516
  // Extract output and exit code from either format:
507
517
  // 1. The structured BashOutput (message-level tool_use_result): its
@@ -576,7 +586,14 @@ export function toolUpdateFromToolResult(toolResult, toolUse, supportsTerminalOu
576
586
  return toAcpContentUpdate(result, isError);
577
587
  }
578
588
  }
579
- if (supportsTerminalOutput) {
589
+ // Without a terminal id there is nothing the client can reconcile these
590
+ // metas against, and emitting them anyway strands the output: a client that
591
+ // buffers output/exit for terminals it has not been told about (Zed keeps
592
+ // them in `pending_terminal_output`/`pending_terminal_exit`, drained only on
593
+ // a matching create) would hold them forever behind an id that never
594
+ // arrives, showing an empty terminal. Fall through to the code-block
595
+ // rendering below instead.
596
+ if (supportsTerminalOutput && terminalId !== undefined) {
580
597
  return {
581
598
  content: [{ type: "terminal", terminalId }],
582
599
  _meta: {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.61.0",
6
+ "version": "0.63.0",
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",
@@ -64,19 +64,19 @@
64
64
  },
65
65
  "dependencies": {
66
66
  "@agentclientprotocol/sdk": "1.3.0",
67
- "@anthropic-ai/claude-agent-sdk": "0.3.217",
67
+ "@anthropic-ai/claude-agent-sdk": "0.3.220",
68
68
  "zod": "^3.25.0 || ^4.0.0"
69
69
  },
70
70
  "devDependencies": {
71
- "@anthropic-ai/sdk": "0.112.5",
71
+ "@anthropic-ai/sdk": "0.115.0",
72
72
  "@eslint/js": "10.0.1",
73
73
  "@tsconfig/node22": "22.0.5",
74
74
  "@types/node": "26.1.1",
75
75
  "@typescript-eslint/eslint-plugin": "8.65.0",
76
76
  "@typescript-eslint/parser": "8.65.0",
77
- "eslint": "10.7.0",
77
+ "eslint": "10.8.0",
78
78
  "eslint-config-prettier": "10.1.8",
79
- "globals": "17.7.0",
79
+ "globals": "17.8.0",
80
80
  "prettier": "3.9.6",
81
81
  "ts-node": "10.9.2",
82
82
  "typescript": "6.0.3",