CodeQL reported a file system race: the test appended to the file by its
path after a stat of the open handle. The test now opens the file for
reading and appending and appends through the same handle.
A client that follows a terminal session polls `_session/read`. When an
Agent call or an append rules out the checkpoint of #1736, each poll read
and parsed the root transcript and every subagent transcript again, and
the SDK built each chain again. A changed cursor renders twice, so a poll
did all of this two times.
- `TranscriptCache` keeps the parsed records of each transcript of the
connection. A read of a grown file parses only the bytes after the last
full line. It parses the whole file again when the device or inode
changed, the file is shorter, or the first or last 4 KB of the read part
changed. It splits lines as `readline` does, so the records are the
records of `readTranscriptEntriesOf`.
- The messages of each transcript are kept for one version of its records:
the root messages for the directory and the rewind point, the messages of
a subagent for its launch. An unchanged subagent needs no parse and no
SDK chain. The SDK copies the `message` of each subagent record, so the
kept messages point to the equal kept record instead.
- It keeps 1,024 files and 256 MB of lines per connection. To keep a new
file, it drops only files that no read used in the last minute, so a
session bigger than the limit keeps the same part from poll to poll. It
drops a file that no read used for 5 minutes. A load, resume, close or
delete drops the files of the session, and a dispose drops all files.
The updates and cursors do not change. On frozen copies of three real
sessions, a warm read and a cold read give the same updates and cursor, and
both equal main. One append poll, then the heap after GC, main / this
change:
- 105 MB root, 1.1 GB of subagents: 5.9-6.1 s / 1.9-2.3 s; 429 / 738 MB;
- 57 MB root, 93 subagents: 4.4 s / 1.3 s; 316 / 557 MB;
- 49 MB root, 380 MB of subagents: 5.7 s / 2.5 s; 632 / 846 MB;
- synthetic, 120 subagents x 400 calls, 140 MB: 3.1 s / 1.9 s;
169 / 349 MB.
A limit of 128 MB keeps 143 MB less heap on the first session, but its
append poll takes 3.3-3.8 s.
A client that follows a terminal session polls `_session/read` with its
cursor. Without this change each poll renders the whole retained history
again, even when nothing was appended.
## What changes
- After a successful cursor read, the connection keeps a checkpoint: the
cursor, the scope, the working directory, the root `replay_complete`
frames, the title and the storage state of the root transcript (device,
inode, mode, size, mtime and ctime).
- A later read with the same cursor first checks that storage state: the
transcript lookup, the file identity, the `custom-title.json` title when
the replay read it, and the absence of `rewind.json`. When nothing
changed, it sends the saved boundary frames and the title, and skips the
render.
- A history gets a checkpoint only when each of its tool calls is Bash,
PowerShell, Read, Write, Edit, Glob or Grep. These tools render their
stored input and result without child transcripts or workspace files.
Any other tool, a pending rewind, a reader restart or a changed file
takes the full replay path from #1729.
- At most 32 checkpoints are kept per connection. A transition (load,
resume, close, delete) of the session drops its checkpoint.
## Verification
`npm run build`, `npm run check` and `npm run test:run` passed (4,968
passed, 65 skipped). A local stdio comparison used 750 synthetic
assistant messages and seven successive quiet polls. The median fell
from 7.7 ms to 0.5 ms on v1 and from 8.8 ms to 0.5 ms on v2.
---------
Co-authored-by: Codex <noreply@openai.com>
A client can follow a terminal-owned Claude Code session through
`_session/read` on ACP v1 and v2. Reading a transcript starts no query,
acquires no writer and leaves no session attached. The existing replay
renderers provide the root and child updates.
## Client contract
Check `_meta.sessionRead.supported`. On v1 declare
`clientCapabilities.session.cursors: {}`. Start with `replayFrom:
{"type":"start"}` and keep the returned `cursorId` with the transcript.
A subsequent `{"type":"cursor","cursorId":"…"}` sends appended updates,
including child-only activity. A quiet poll keeps the ID. On v2 it still
sends the current root title (or `null` to clear it) after
`replay_complete`. A v1 rename can invalidate its cursor. Commit staged
updates only on success. A changed prefix returns `invalid_cursor` and
calls for a full read.
## Scope and trade-offs
The wire contract follows [codex-acp
#820](https://github.com/agentclientprotocol/codex-acp/pull/820). The
motivating Claude scenarios and alternative history-tail design are in
[#1723](https://github.com/agentclientprotocol/claude-agent-acp/pull/1723).
- A saved cursor works in a new adapter process. Each poll renders the
retained history and sends only the additions. Initial and changed
cursor reads verify the rendering twice because a terminal can change
the root and child files independently. Skipping the render for an
unchanged session is the separate follow-up
[#1736](https://github.com/agentclientprotocol/claude-agent-acp/pull/1736).
- Root and child messages are delivered together in replay order. Final
child-state reports have their own prefix because the Claude renderer
emits them at the end of the parent replay, even after later parent
messages.
- The client gets one complete suffix per read. This deliberately leaves
out a separate paging API, lazy child selector, parsed-history cache and
load-to-read cursor handoff. AIR can use its existing session index for
activity. The read response carries no separate `turnOpen` or `held`
field.
- History and title lookups use the same captured transcript size. A
later append is available on the next poll. An unreadable required file
fails the read. The client can retry with the last successful cursor.
The SDK's existing transcript projection still determines which tool
results and branches are visible.
- Changes to writer admission belong to the separate writer-guard
follow-up
[#1730](https://github.com/agentclientprotocol/claude-agent-acp/pull/1730).
## Review order
1. Read transcript snapshots and propagate read errors.
2. Validate replay cursors and serialize reads with lifecycle
operations.
3. Connect the ACP v1 load renderer and test the wire contract.
4. Connect the ACP v2 resume renderer and update its initialize
fixtures.
5. Document polling and recovery.
The later review commits cover v2 title synchronization and bounded
reads of the transcript and its title sidecar.
## Verification
`npm run build`, `npm run check` and the full default test suite passed
with an isolated Claude configuration (4,963 passed, 65 skipped). Before
the split into #1735 (merged) and #1736, a separate stdio smoke test ran
the built binary for both protocols, restarted the reader, appended a
record from outside the adapter, and checked that a quiet poll and a
one-message suffix preserved the transcript bytes. The tests also cover
title clearing, a transient rewind or title file during replay, and
appends after the captured byte boundary.
---------
Co-authored-by: Codex <noreply@openai.com>
Stacked on #1737: both change `SessionModeManager` and the mode tests.
Merge #1737 first. GitHub then points this PR at `main`.
The adapter decides a session's permission mode itself and passes it to
Claude Code at launch. Claude Code can then end up in another mode, and
the adapter never heard of it: neither core read the mode that Claude
Code reports.
## What went wrong
With a client's `settings` that disable Auto mode (`disableAutoMode:
"disable"`), on a machine whose default mode is `auto`:
- the adapter starts the session with `--permission-mode auto` and shows
Auto;
- Claude Code starts in `auto` and moves to `default` a moment later;
- the session's mode option keeps showing Auto while every tool call
asks for permission.
Seen on v1 and v2 with Claude Code 2.1.333.
## Change
Claude Code reports the session's mode in two frames, both declared in
the SDK types:
- `system`/`status` with `permissionMode`, after a change. It sends one
after a change that the adapter asked for too.
- `system`/`init` with `permissionMode`, at the start of each turn.
Both cores now record that mode and tell the client:
- `SessionModeManager.modeReported` (`src/session-mode.ts`) owns the
rule for v1: nothing for the mode already recorded, a log line for a
mode that the session does not offer, and nothing for a frame of a query
that the session no longer runs on. The v1 loop calls it for both
frames, and the `EnterPlanMode` hook goes through it as well, so the
first of the hook and the frame is recorded.
- v2 calls its existing `modeChanged` for both frames. It already had
the same two checks for `EnterPlanMode`.
The `init` frame is needed beside the `status` frame: in three live runs
of the case above on v1, the `status` frame reached the loop once. In
the other two, the first report of `default` was the `init` frame of the
first turn. On v2 the `status` frame arrived in all three runs.
`current_permission_mode` in the answer to the initialize request is not
used. The SDK types do not declare it, and in two of three runs it still
said `auto`.
## Limits
- The `session/new` response can still say `auto`. On v1 the correction
arrives when the first turn starts: the adapter reads Claude Code's
frames from the first prompt on. On v2 it arrived within 1.5 seconds of
`session/new`, before any prompt, in three of three runs.
- The mode list still offers Auto in that session. Choosing it fails
with Claude Code's own message, "Cannot set permission mode to auto:
auto mode disabled by settings".
- Nothing ties a frame to the request that caused it. After two quick
mode changes by the client, the first one's frame can arrive when the
second mode is already recorded, and the session shows the first mode
until the second frame arrives.
## Checked against Claude Code 2.1.333
- The case above, three runs each on v1 and v2: the client is told
`default` once in every run.
- A plan approved from plan mode, on v1 and v2: the same updates as
before the change, in the same order.
- A subagent with its own `permissionMode` does not report it as the
session's mode.
## Testing
- `src/tests/session-mode.test.ts`: a reported mode is recorded and
announced; nothing for the recorded mode, for a mode that the session
does not offer (logged), and for a frame of a former query.
- `src/tests/v1/acp-agent.test.ts`, `src/tests/v2/v2.test.ts`: both
frames change the session's mode in each core.
- `npm run build`, `npm run check` and `npm run test:run` (4,959 tests
pass), and the whole suite against Claude Code 2.1.333 with
`RUN_INTEGRATION_TESTS=true` (5,010 tests pass), on this branch together
with #1737, #1738, #1739 and #1741. In that run the 10 s `tsc` setup
hook of "ACP subprocess integration" timed out on a loaded machine; that
suite passes by itself.
Since SDK 0.3.332, `Query.setPermissionMode()` resolves with `{ mode }`:
the permission mode that is in effect after the call. The SDK's doc says
that this is not always the mode asked for, and that a caller should
record `mode`, not its argument. The adapter recorded its argument.
## Change
- `SessionModeManager.setQueryMode` (`src/session-mode.ts`) sets the
mode and returns the one that Claude Code names. Every mode change of v1
goes through it or through `trySyncMode`, which now returns the named
mode too. v2's `SessionConfig.applyMode` calls `setQueryMode`.
- The mode asked for is kept where the answer names no mode (a Claude
Code before 2.1.332), and where it names a mode that the session does
not offer. The second case is logged: a session's current mode is always
one of its available modes.
- A refused mode still rejects the request, as before.
## Checked against Claude Code 2.1.333
- `auto`, `plan`, `acceptEdits`, `dontAsk` and `default` each answer
with the same mode.
- Refused modes reject: `bypassPermissions` in a session not started for
it, `bypassPermissions` and `auto` when settings disable them.
- I found no request for which Claude Code 2.1.333 names another mode
than the one asked for. The change follows the SDK's contract, so that
the mode option stays right when it does.
## Testing
- `src/tests/session-mode.test.ts`: the named mode is recorded and
announced; the asked mode is kept for an answer without a mode and for a
mode that the session does not offer.
- `src/tests/v2/v2.test.ts`: the mode option of a v2 session shows the
named mode.
- `npm run build`, `npm run check` and `npm run test:run` (4,959 tests
pass), and the whole suite against Claude Code 2.1.333 with
`RUN_INTEGRATION_TESTS=true` (5,010 tests pass), on this branch together
with #1738, #1739, #1740 and #1741. In that run the 10 s `tsc` setup
hook of "ACP subprocess integration" timed out on a loaded machine; that
suite passes by itself.
Stacked on #1739: SDK 0.3.333 is what makes stdin the default. Merge
#1739 first. GitHub then points this PR at `main`.
The adapter sends a session's MCP servers and settings over stdin to the
Claude Code that it ships, and in the `--mcp-config` and `--settings`
flags to a Claude Code that `CLAUDE_CODE_EXECUTABLE` names. The second
rule was there because the version of such a CLI is not known, and one
before 2.1.326 cannot read MCP servers from stdin.
SDK 0.3.333 makes stdin the default for MCP servers, and Claude Code's
`stable` tag is at 2.1.330. So the adapter now uses stdin for every
Claude Code.
## Change
- `cliDelivery` (`src/claude-cli.ts`) no longer looks at
`CLAUDE_CODE_EXECUTABLE`. Settings still go in the flag when the
client's `extraArgs` hold `settings` or `sdk-url`, as before.
- **Behavior change:** a `CLAUDE_CODE_EXECUTABLE` CLI must be Claude
Code 2.1.328 or newer. With an older one, a session with MCP servers
(before 2.1.326) or with settings (before 2.1.328) does not start. A
session with neither still starts.
- `outdatedCliError` turns the two failures of such a CLI into one error
that names the variable and what to do. `startupFailureError` returns
it, so every request of v1 and v2 that starts Claude Code reports it:
> The Claude Code that CLAUDE_CODE_EXECUTABLE names (/opt/claude) is too
old: it cannot take a session's MCP servers and settings over stdin.
Update it to 2.1.328 or newer, or unset CLAUDE_CODE_EXECUTABLE to use
the Claude Code that comes with the adapter.
The failure's own text is in `data.details`.
- README: the note on `CLAUDE_CODE_EXECUTABLE` states the minimum
version.
## Checked through the built adapter, v1 and v2
| `CLAUDE_CODE_EXECUTABLE` | plain session | with MCP servers | with
client settings |
| --- | --- | --- | --- |
| Claude Code 2.1.323 | starts | the error above | the error above |
| Claude Code 2.1.326 | starts | starts | the error above |
The v2 integration tests check against Claude Code 2.1.333 that both go
over stdin.
## Testing
- `src/tests/claude-cli.test.ts`: `cliDelivery` for a
`CLAUDE_CODE_EXECUTABLE`, and `outdatedCliError` for both recorded
failures and for the failures it leaves alone.
- `src/tests/v1/create-session-options.test.ts`,
`src/tests/v2/acp-v2.test.ts`: `session/new` fails with the error in
both cores.
- `npm run build`, `npm run check` and `npm run test:run` (4,959 tests
pass), and the whole suite against Claude Code 2.1.333 with
`RUN_INTEGRATION_TESTS=true` (5,010 tests pass), on this branch together
with #1737, #1738, #1739 and #1740. In that run the 10 s `tsc` setup
hook of "ACP subprocess integration" timed out on a loaded machine; that
suite passes by itself.
Updates the dependencies to their latest versions. #1726 moved the
Claude Agent SDK to 0.3.332 without a changelog review, so this covers
the Claude Agent SDK and Claude Code changelogs of both 0.3.332 and
0.3.333.
## Dependencies
| Package | From | To |
| --- | --- | --- |
| `@anthropic-ai/claude-agent-sdk` | 0.3.332 | 0.3.333 (Claude Code
2.1.333) |
| `@anthropic-ai/sdk` | 1.14.0 | 1.15.0 |
| `globals` | 17.14.0 | 17.15.0 |
Lockfile only, within the existing ranges: `brace-expansion` 5.1.2,
`cross-spawn` 7.1.2, `flatted` 3.5.1, `ignore` 7.0.17, `jose` 6.2.19,
`minimatch` 11.0.10, `source-map-js` 1.3.0.
Not updated: `typescript` 7.0.2. `@typescript-eslint/parser` 8.74.0
needs `typescript <6.1.0`.
## Changelog review
The update needs no change of behavior in the adapter. One comment is
updated (see the fork entry).
- **0.3.333, breaking: `mcpServersDelivery` defaults to
`'initialize'`.** The adapter sets the option for every session
(`cliDelivery`), so its delivery does not change.
- **0.3.332: `Query.setPermissionMode()` resolves with the mode in
effect.** The adapter awaits the call and ignores the answer, so it
still compiles. #1737 records the answer.
- **0.3.332: mid-turn user messages count as the user's in auto mode.**
The adapter writes two user messages of its own, `/compact` for the idle
compaction and the plan continuation, and both stand for a choice of the
user. Nothing to mark as synthetic.
- **Claude Code 2.1.332 no longer streams the result that a foreground
fork inherits for its own launch** ("Fork started — that fork is you.").
The v1 loop drops that frame so that it cannot complete the Agent call
early. Checked live: 2.1.326 sends the frame, 2.1.333 does not. With
2.1.326 as the `CLAUDE_CODE_EXECUTABLE`, v1 completes the Agent call
once with the fork's report, and v2 shows the fork as a child session.
The filter stays for such an older CLI, and its comment now names the
version.
- **0.3.333: `getSubagentMessages()` no longer drops parallel tool
calls.** The replay of a subagent's history gets the fix without a
change.
- **2.1.332: skills from MCP servers (beta)** are listed as
`server:skill`. The adapter lists and sends command names as Claude Code
reports them, so they pass through. Not checked live: it needs an MCP
server that serves `skills/list`.
- Not adopted: `tool_progress.description`, `gitOperation.pr.changed`,
the `PreSkillShellCommand` hook event,
`tool_result_meta[].rewritten_by_plugin`.
## Testing
- `npm run build`, `npm run check` and `npm run test:run` (4,959 tests
pass), and the whole suite against Claude Code 2.1.333 with
`RUN_INTEGRATION_TESTS=true` (5,010 tests pass), on this branch together
with #1737, #1738, #1740 and #1741. In that run the 10 s `tsc` setup
hook of "ACP subprocess integration" timed out on a loaded machine; that
suite passes by itself.
- On this branch alone, one test of the whole suite fails against the
real CLI: "keeps a provider's route when Claude Code does not load the
client's settings" in `v2-integration.test.ts`. It fails on `main` too,
since #1719, and #1738 fixes it.
"keeps a provider's route when Claude Code does not load the client's
settings" (`src/tests/v2/v2-integration.test.ts`, from #1691) fails on
`main` since #1719. It runs only with `RUN_INTEGRATION_TESTS=true`, so
CI does not show it.
The test starts a session with client settings that Claude Code skips as
invalid. It expected the session to start and to send its model request
to the provider. Since #1719 the adapter refuses such a session.
The test now expects that refusal: `session/new` fails with "Claude Code
skipped the invalid settings file … (permissions.allow: Expected
array…)", and no model request reaches the provider or the project's
`ANTHROPIC_BASE_URL`.
## Testing
- The test passes against Claude Code 2.1.332 (what `main` ships) and
2.1.333.
- The whole suite against Claude Code 2.1.333 with
`RUN_INTEGRATION_TESTS=true`, on this branch together with #1737, #1739,
#1740 and #1741: 5,010 tests pass. In that run the 10 s `tsc` setup hook
of "ACP subprocess integration" timed out on a loaded machine; that
suite passes by itself.
The session index read the `custom-title.json` sidecar and applied the
SDK's title rule in two places: `SessionIndex.titlesOf` and `copyTitle`
in the service. `readTranscriptTitles` in `transcript-scan.ts` now does
both from one head and tail read. The sidecar path and reader move next
to the other transcript scans.
No behavior change. The sidecar is still read only when the tail has no
`custom-title` record, and the title order is the same `sdkTitles` rule.
This prepares
[#1729](https://github.com/agentclientprotocol/claude-agent-acp/pull/1729),
which reads the same titles for `_session/read`.
## Verification
`npm run build`, `npm run check` and `npm run test:run` passed (4,940
passed, 65 skipped).
The skill-cache regression test checked `SKILL.md` by path and reopened
the path to rewrite it. CodeQL flagged the gap between those operations
(`js/file-system-race`).
Use one open file descriptor to check the metadata, rewrite the
contents, and restore the timestamps. The test verifies that the file
size and modification time match across the rewrite and that the cache
resolves the new skill name.
## Verification
- `npm run check`
- `npm run build`
- `npm run test:run` (4,940 passed, 65 skipped)
Bumps
[@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime)
from 7.29.15 to 7.29.16.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/babel/babel/releases">@babel/runtime's
releases</a>.</em></p>
<blockquote>
<h2>v7.29.16 (2026-11-27)</h2>
<h4>🐛 Bug Fix</h4>
<ul>
<li><code>babel-plugin-transform-typescript</code>
<ul>
<li><a
href="https://redirect.github.com/babel/babel/pull/18751">#18751</a> Fix
ts enum negative and block merge (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
<li><a
href="https://redirect.github.com/babel/babel/pull/18720">#18720</a>
fix(ts): don't share enum values between nested enums with the same name
(<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
</li>
<li><code>babel-helpers</code>,
<code>babel-plugin-transform-spread</code>,
<code>babel-runtime-corejs3</code>
<ul>
<li><a
href="https://redirect.github.com/babel/babel/pull/18750">#18750</a> Fix
spread for arrays with a custom iterator (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
</li>
<li><code>babel-plugin-transform-regenerator</code>,
<code>babel-traverse</code>
<ul>
<li><a
href="https://redirect.github.com/babel/babel/pull/18748">#18748</a>
fix(traverse,transform-regenerator): resolve var binding scope on
removal (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
</li>
<li><code>babel-generator</code>
<ul>
<li><a
href="https://redirect.github.com/babel/babel/pull/18749">#18749</a>
fix(generator): avoid newlines and parens after no-LineTerminator tokens
(<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
<li><a
href="https://redirect.github.com/babel/babel/pull/18729">#18729</a>
fix: only separate <code>></code> from <code>=</code> &
<code>></code> after TS instantiation expression (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
<li><a
href="https://redirect.github.com/babel/babel/pull/18685">#18685</a>
fix: add generator <code>retainLines</code> roundtrip test (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
</li>
<li><code>babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining</code>,
<code>babel-plugin-proposal-function-bind</code>,
<code>babel-plugin-proposal-partial-application</code>,
<code>babel-plugin-proposal-pipeline-operator</code>,
<code>babel-plugin-transform-destructuring</code>,
<code>babel-plugin-transform-for-of</code>,
<code>babel-plugin-transform-logical-assignment-operators</code>,
<code>babel-plugin-transform-optional-chaining</code>,
<code>babel-plugin-transform-react-constant-elements</code>,
<code>babel-plugin-transform-spread</code>, <code>babel-traverse</code>
<ul>
<li><a
href="https://redirect.github.com/babel/babel/pull/18745">#18745</a>
Treat imported bindings as not constant (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
</li>
<li><code>babel-core</code>,
<code>babel-plugin-transform-modules-systemjs</code>,
<code>babel-traverse</code>
<ul>
<li><a
href="https://redirect.github.com/babel/babel/pull/18742">#18742</a>
fix: Should respect <code>noScope</code> (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
</li>
<li><code>babel-helpers</code>,
<code>babel-plugin-transform-destructuring</code>,
<code>babel-plugin-transform-modules-commonjs</code>,
<code>babel-runtime-corejs2</code>, <code>babel-runtime-corejs3</code>,
<code>babel-runtime</code>
<ul>
<li><a
href="https://redirect.github.com/babel/babel/pull/18741">#18741</a> Fix
<code>_arrayWithHoles</code> bypassing custom
<code>Symbol.iterator</code> on array-backed Proxies (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
</li>
<li><code>babel-plugin-transform-regenerator</code>
<ul>
<li><a
href="https://redirect.github.com/babel/babel/pull/18722">#18722</a>
fix(regenerator): compile <code>yield</code> in object spreads and
computed keys (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
<li><a
href="https://redirect.github.com/babel/babel/pull/18711">#18711</a>
fix: reject untranspiled ??, &&=, ||=, ??= before yield
expression (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
</li>
<li><code>babel-generator</code>, <code>babel-parser</code>
<ul>
<li><a
href="https://redirect.github.com/babel/babel/pull/18724">#18724</a>
fix: handle TSInstantiation before <code><</code> (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
</li>
<li><code>babel-plugin-transform-block-scoping</code>
<ul>
<li><a
href="https://redirect.github.com/babel/babel/pull/18716">#18716</a>
fix(block-scoping): don't add TDZ checks for loop head refs in the body
(<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
</li>
<li><code>babel-helpers</code>,
<code>babel-plugin-transform-class-static-block</code>,
<code>babel-runtime-corejs3</code>
<ul>
<li><a
href="https://redirect.github.com/babel/babel/pull/18721">#18721</a>
fix(helpers): name functions "[]" for symbols with an empty
description (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
</li>
<li><code>babel-traverse</code>
<ul>
<li><a
href="https://redirect.github.com/babel/babel/pull/18715">#18715</a>
Make <code>getFunctionParent</code> skip decorators/keys (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
</li>
<li><code>babel-plugin-transform-proto-to-assign</code>
<ul>
<li><a
href="https://redirect.github.com/babel/babel/pull/18706">#18706</a>
fix(proto-to-assign): only transform prototype setters (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
</li>
<li><code>babel-helper-create-class-features-plugin</code>,
<code>babel-plugin-transform-class-properties</code>,
<code>babel-plugin-transform-new-target</code>
<ul>
<li><a
href="https://redirect.github.com/babel/babel/pull/18704">#18704</a>
fix(class-features): <code>new.target</code> is undefined in instance
field initializers (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
</li>
<li><code>babel-helper-replace-supers</code>,
<code>babel-plugin-transform-classes</code>,
<code>babel-plugin-transform-object-super</code>
<ul>
<li><a
href="https://redirect.github.com/babel/babel/pull/18703">#18703</a>
fix(replace-supers): keep the receiver of super tagged templates (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
</li>
<li><code>babel-helper-create-class-features-plugin</code>,
<code>babel-plugin-proposal-decorators</code>,
<code>babel-plugin-proposal-do-expressions</code>,
<code>babel-plugin-transform-class-properties</code>,
<code>babel-plugin-transform-classes</code>,
<code>babel-plugin-transform-modules-amd</code>,
<code>babel-plugin-transform-modules-commonjs</code>,
<code>babel-plugin-transform-modules-systemjs</code>,
<code>babel-plugin-transform-private-methods</code>,
<code>babel-plugin-transform-private-property-in-object</code>,
<code>babel-plugin-transform-spread</code>,
<code>babel-plugin-transform-typescript</code>,
<code>babel-preset-typescript</code>
<ul>
<li><a
href="https://redirect.github.com/babel/babel/pull/18701">#18701</a>
fix(class-features): do not compile accessor properties as fields (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
</li>
<li><code>babel-plugin-transform-classes</code>
<ul>
<li><a
href="https://redirect.github.com/babel/babel/pull/18697">#18697</a>
fix(transform-classes): throw on class elements that are not compiled
(<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
</li>
<li><code>babel-helpers</code>,
<code>babel-plugin-proposal-import-defer</code>,
<code>babel-plugin-transform-dynamic-import</code>,
<code>babel-plugin-transform-modules-amd</code>,
<code>babel-plugin-transform-modules-commonjs</code>,
<code>babel-plugin-transform-modules-systemjs</code>,
<code>babel-runtime-corejs3</code>
<ul>
<li><a
href="https://redirect.github.com/babel/babel/pull/18696">#18696</a>
fix(modules): do not compile <code>import.{defer,source,sync}()</code>
as <code>import()</code> (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
</li>
</ul>
<h4>🔬 Output optimization</h4>
<ul>
<li><code>babel-helper-module-transforms</code>,
<code>babel-plugin-transform-dynamic-import</code>
<ul>
<li><a
href="https://redirect.github.com/babel/babel/pull/18693">#18693</a>
fix(dynamic-import): treat template literals without expressions as
static specifiers (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
</li>
</ul>
<h4>Committers: 2</h4>
<ul>
<li>Babel Bot (<a
href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c226c86fd7"><code>c226c86</code></a>
v7.29.16</li>
<li><a
href="87564ec61e"><code>87564ec</code></a>
Fix <code>_arrayWithHoles</code> bypassing custom
<code>Symbol.iterator</code> on array-backed Prox...</li>
<li>See full diff in <a
href="https://github.com/babel/babel/commits/v7.29.16/packages/babel-runtime">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
## Summary
CodeQL flagged the reusable binary workflow because callers could supply
the checkout ref. PR and push builds now use the event SHA. For a manual
release rebuild, `find-release` checks that the requested ref matches
the release tag and passes the tag’s resolved commit SHA to every
runner. A missing or malformed SHA stops the rebuild before checkout.
The checkout also clears its Git credentials before the build scripts
run.
## Verification
- Reproduced `actions/untrusted-checkout/medium` on `main`. The patched
workflows had zero alerts across all five files in CodeQL’s extended
Actions suite.
- Ran `actionlint` and `npm run check`.
- Exercised PR, push, and manual rebuild paths locally, including a
complete release, a mismatched release ref, and a missing SHA.
## Problem
[IJAI-4341](https://youtrack.jetbrains.com/issue/IJAI-4341): in an ACP
client (Air's Chat mode), an MCP server from Claude Code's settings or
the project's `.mcp.json` that needs OAuth stays `needs-auth`. `/mcp
reconnect <server>` answers "Couldn't reconnect: Server status:
needs-auth" and offers no sign-in. The only way around it was to sign in
from the Claude Code terminal UI.
## Causes
1. **v1:** after `/mcp reconnect`, OAuth started only for servers in the
session's ACP `mcpServers`.
2. **v2:** a reconnect never started OAuth. The `/mcp` text replacement
also never ran with the real CLI. In SDK mode, Claude Code sends a
`<synthetic>` assistant message before the result. v2 showed that
message, so the replacement, which runs only when no agent text has been
sent yet, was skipped. The v2 test double sent only the result.
3. **Shared:** startup OAuth for ACP servers read the status once, right
after `session/new`. On a warm start every server is still `pending`, so
none was signed in. An OAuth request that arrived while a run was in
progress was dropped without notice.
## Changes
- **`src/v1/acp-agent.ts`, `src/v2/session.ts`:** a reconnect starts
OAuth for each server it tried. The OAuth run skips those that aren't
`needs-auth`. A cancelled turn starts none.
- **`src/v2/session.ts`:** during an adapter `/mcp` turn, v2 drops the
`<synthetic>` copy, so the result's text is replaced as on v1.
- **`src/mcp-oauth.ts`:** a server that reads `pending` is checked again
once a second, up to the existing 10-minute limit. Servers requested
while a run is in progress join that run.
- **Docs:** `scratch/` is gitignored and described in `AGENTS.md` as the
place for one-off reproductions.
At session start, servers from settings or `.mcp.json` still don't
prompt for sign-in, as before (see `reportMcpServerStartupFailures`).
The user signs in with `/mcp reconnect <server>`.
## Testing
- **Unit tests:**
- The v1 double now refuses to reconnect a `needs-auth` server, as the
real CLI does.
- The v2 `/mcp` test now uses the real message sequence: `<synthetic>`
assistant message, then the result.
- New tests cover: a reconnect of a server that isn't from ACP (v1 and
v2), a cancelled v2 reconnect, a `pending` server at startup, and a
reconnect during an open sign-in.
- **Real CLI:** an OAuth-protected test MCP server and a raw ACP client
that advertises URL elicitation. Tested on v1 and v2, with the server in
`.mcp.json` and in `session/new`. Before the fix, the `.mcp.json` case
reproduces the issue. After it, the server signs in via `/mcp reconnect`
and connects. A warm start now signs in to ACP servers.
- `npm run check`, `npm run build`, `npm run test:run`.
## Known gap
If a Claude Code build sends `/mcp` output as `local_command_output`, v2
still shows Claude Code's text. v1 handles that shape and the bundled
CLI doesn't send it.
## Problem
In ACP v1 sessions with the `asyncTasks` capability, the "Claude is
working" task of an autonomous turn (one that a background task's
notification or a scheduler fire started) could not be stopped while the
user's next prompt waited behind it: `_session/async_task/stop` returned
`{ "stopped": false }`. The refusal assumed that the interrupt would
drop the waiting prompt.
## What the CLI actually does
Pinned by `src/tests/interrupt-queued-prompt-integration.test.ts`
against the bundled CLI:
- `interrupt()` returns `{ still_queued: [<waiting prompt uuid>] }`;
- the interrupted turn ends with its own result
(`error_during_execution`, `terminal_reason: "aborted_streaming"`,
`origin.kind: "task-notification"`), which does not name the waiting
prompt;
- the CLI then runs the waiting prompt by itself and ends it with a
normal result.
## Change
- `stopAsyncTask` interrupts the autonomous turn unless a waiting prompt
was already dispatched into a turn (a `started` lifecycle frame) or the
CLI sends no message lifecycle frames; in those cases it still returns
`{ stopped: false }`.
- A stop owes the interrupted turn's aborted result. The result handler
routes that result to the autonomous turn even when it has no `origin`
(a scheduler fire), so it does not end the waiting prompt.
- If a waiting prompt is missing from the receipt's `still_queued`, it
is logged.
- The logic lives in `async-task-stop.ts` (`interruptAutonomousTurn`)
and `AsyncTaskRuntime.startedByClaudeCode`; `acp-agent.ts` calls them.
- `docs/air-extensions.md` describes when the stop is refused.
v2 is unchanged: it has no autonomous-turn tasks.
## Tests
- Unit tests for the refusal rule, the owed result, and
`interruptAutonomousTurn`.
- Two integration tests (`RUN_INTEGRATION_TESTS=1`) that run the bundled
CLI against a scripted model on 127.0.0.1 in a throwaway home, so no
account or API usage: one pins the CLI behaviour above, one runs the
stop end to end through `ClaudeAcpAgent`. The end-to-end test fails on
`main`.
## Problem
When a Claude Code settings file (for example `~/.claude/settings.json`)
has a JSON syntax error or fails validation, Claude Code skips the whole
file. Its permission allow/deny rules, sandbox settings and hooks are
not applied. The `claude` CLI warns about this at startup, but an ACP
session started silently without those settings, and nothing told the
user.
## Fix
The adapter already sends `get_settings` at every session start (for the
ultracode state). Its response lists the skipped files in `errors`
(`SDKSettingsParseError[]`), which the adapter ignored.
- `readUltracodeSettings` is renamed to `readSettingsReport` and also
returns those errors from the same request. There is no second round
trip.
- `rejectSkippedSettings` (in `startup-failure.ts`, next to the other
start failures) throws a `RequestError` when the list is not empty, for
example:
> Claude Code skipped the invalid settings file
/home/u/.claude/settings.json (Invalid or malformed JSON), so its
permission rules, sandbox settings and hooks would not apply. Fix the
file and start the session again.
`data.settingsErrors` carries the entries as the CLI reported them.
- v1 `createSession` and v2 `SessionConfig.start` call it. The existing
catch blocks close the query, and no session is registered. This applies
to `session/new`, `load`, `resume`, `fork` and `session/options` on both
protocol versions.
- v2: the `SessionConfig.start` catch also ends the session's auth and
subscription-guard entries when no live session holds that id.
## Notes
- A restart inside a session (provider switch, sign-out respawn, fresh
context after plan mode) is refused the same way when a file broke after
the session started.
- These already happen on any start failure and are unchanged here: a
refused `session/fork` leaves its copied transcript behind, and the v2
`sessionModels` catch does not end the auth and guard entries.
## Tests
- Unit tests for `rejectSkippedSettings` and for the reader's handling
of `errors`.
- v1 and v2: `session/new` and `session/options` reject with the error,
close the query and register no session.
- `npm run check` and `npm run build` pass. `npm run test:run` has 31
failures in `v1/create-session-options`, `v1/providers` and `v2/acp-v2`.
They are the same tests, by name, that fail on `main` at 9918571.
v0.110.1, v0.111.0 and v0.112.0 reached npm without binaries. In each
run one `Build binaries` job failed, `upload-binaries` was skipped, and
`trigger-registry-update` dispatched anyway, so the registry rejected
the update and stayed on 0.110.0.
## Root causes
From about 3,600 binary jobs, Oct 28 – Nov 25:
- **darwin-arm64:** no macOS arm64 runner picked up the job within 15
minutes, so GitHub cancelled it. This happened to 22 of 452 jobs. It's a
GitHub capacity problem; nothing inside the job can retry it.
- **windows-arm64:** the smoke test's cleanup threw EPERM on its scratch
directory after every check had passed. This happened to 11 of about 450
jobs: Windows briefly keeps a handle open after the process exits.
## Changes
- **`smoke-binary.mjs`:** cleanup retries. A directory that stays locked
is left behind with a warning instead of failing the job.
- **`retry-binaries.yml` (new):** reruns a release's failed binary jobs
up to twice, as long as nothing else failed. This works around the
runner-capacity limit.
- **`upload-binaries`:** attaches every archive that built and the
release lacks, even if another build failed. While any archive is
missing, it puts a warning naming them at the top of the release notes
and fails red. It never replaces an archive that's already attached. A
rerun that completes the release removes the warning.
- **`scripts/missing-release-archives.sh` (new):** lists the archives a
release lacks, taking the expected list from the build matrix in
`binaries.yml`. `upload-binaries` checks the release itself rather than
the run's artifacts, so `gh run rerun --failed` still completes a
release after the 7-day artifact expiry.
- **`trigger-registry-update`:** a stable release dispatches only once
its release has every archive.
- **Manual stable run:** a new `find-release` job checks the release for
the version at `ref`. If archives are missing, the run builds them from
the tag's commit and attaches only the missing ones. A complete release
is not rebuilt.
- **`docs/RELEASES.md`:** the recovery steps are updated.
## Testing
`npm run check`, the smoke test on macOS, the script against the real
releases (v0.112.0 complete, v0.111.0 missing all 8, unknown tag fails),
and the upload steps against a stubbed `gh` (partial build, late rerun,
nothing missing, every build failed, warning already present). It hasn't
run on GitHub yet: `retry-binaries.yml` only fires from `main`, and the
manual path can be tried with `gh workflow run publish.yml -f
ref=v0.111.0 -f publish_npm=false`.
Closes#580.
In an ACP session, `/plugin …` (and its aliases `/plugins`,
`/marketplace`) answers "/plugin isn't available in this environment."
Claude Code defines `/plugin` as an Ink-only `local-jsx` command and
refuses it outside the interactive terminal by design, so the adapter
can't just forward it. The adapter now serves it itself, as it already
does for `/remote-control`.
## What
A `Monitor` or `Workflow` call whose task joins Claude Code's live
background set after the call's result now stays that task's entity: the
call is kept `in_progress`, and a later level names it instead of
`adoptTasks()` starting a separate `task_<taskId>` card.
I have not seen this order with the real CLI; #1537 described it from
the adapter's own tests. The SDK promises no order between a tool result
and `background_tasks_changed`, so it can happen.
## Why
`toolResults()` kept a task call only when the live set (the list of
running tasks that Claude Code sends in `background_tasks_changed`)
already named the task; when the level named it later, the call had
ended and `adoptTasks()` could start a separate card. This ports the fix
from the closed branch #1537 to current main, where
`src/background-work.ts` no longer exists:
- `toolResults()` keeps the call in `toolCalls` with an `unleveled` flag
when the level does not name the task yet, and keeps that call running
in the result's own updates. A task that already ended before the result
is remembered (`endedTasks`), so its call is not kept for a level that
can no longer name it;
- `levelChanged()` clears the flag and reports the call `in_progress`
when the level names the task; if the task is not the call's (for
example a `local_bash` task of a PowerShell call), the call ends
`completed` as its result reported it, before the level publishes;
- one `keepsTaskCall()` helper applies the existing rule in both places
— always skip `local_agent`, and skip `local_bash` only when the tool is
not in `TASK_TOOLS` (Claude Code reports a Monitor's task as
`local_bash`) — so the two copies cannot drift apart again;
- because the call lives in `toolCalls`, `closeTurn()`, `queryEnded()`
and `backgroundCalls()` end it as they end any background call.
Comments in the file header, `levelChanged()`, `adoptTasks()` and the
`task_<taskId>` example match the behaviour.
## Tests
In `src/tests/v2/acp-v2.test.ts`:
- `it.each` over a Monitor (`local_bash` task, as the CLI sends it) and
a Workflow whose level arrives after the result: the whole trace asserts
the call goes `pending` → `in_progress` (result) → `in_progress`
(level), never `completed` before the notification, and no
`task_<taskId>` card is listed;
- a Monitor call whose task ends before the result arrives (level,
`task_started`, `task_notification`, a level without the task, then the
result): the call stays `completed` and is unlisted — this order failed
on the previous revision;
- a PowerShell call whose level names a `local_bash` task that is not
the call's: the call ends `completed` rather than staying `in_progress`;
- `monitorStarts()` gained a result-first order; the Workflow helper
reuses the `workflow` task constant.
```console
$ npx tsc --noEmit # clean
$ npx eslint src/v2/tasks.ts src/tests/v2/acp-v2.test.ts
$ npx prettier --check src/v2/tasks.ts src/tests/v2/acp-v2.test.ts
$ npx vitest run src/tests/v2/ # 555 passed, 4 skipped
```
I also applied the patch to current `main` (`9d71d12`) locally: it
applies cleanly and `src/tests/v2/` is 567 passed / 5 skipped there. The
PR branch itself is not rebased.
## Related
Supersedes #1537, which was based on the removed
`src/background-work.ts`. The Monitor-as-`local_bash` task type comes
from #1606.
---------
Co-authored-by: Andrey Bragin <andrey.bragin@jetbrains.com>
Closes#1396.
Terminal sessions connect to Remote Control on their own when
`remoteControlAtStartup` is on. Sessions started over ACP don't, so you
have to type `/remote-control` in each one.
Claude Code already reports this at startup: `initializationResult()`
includes `remote_control_auto_enable`. When it's true, the adapter now
turns Remote Control on right after the session is set up, with the same
`enableRemoteControl` call that `/remote-control` uses.
- It works for new, loaded, resumed and forked sessions, on ACP v1 and
v2. It runs once per query, so a session whose query restarts (after a
provider change or a sign-out, for example) connects again, since Remote
Control ended with the old query. A `/remote-control off` holds across
those restarts: the new query doesn't turn it back on. On v1, a plan
approved with a fresh context also restarts the query, but in the middle
of the turn, so it doesn't connect then.
- The result goes out as a notice instead of an agent message, since
nothing is mid-turn at that point. Clients without notice support get a
transcript line.
- A notice can't be withdrawn, so it says "Remote Control connected" (an
event) rather than "is active", which `/remote-control off` would make
untrue.
- Like `/remote-control`, it holds prompts back while it connects, and
it does nothing while Claude is already working. On v1, a
`/remote-control` sent while it connects is refused ("Try again in a
moment"), as during another `/remote-control`.
- `remote_control_auto_enable` isn't in the SDK's published types, so
it's typed locally like `enableRemoteControl`. A missing field means
off.
- Both cores share the startup steps through `RemoteControlAtStartup` in
`src/remote-control.ts`, beside the existing Remote Control helpers.
Each core holds prompts back and sends the notice its own way: v2 in
`src/v2/remote-control.ts`, v1 in the new `src/v1/remote-control.ts`,
which `/remote-control` now uses too.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Andrey Bragin <andrey.bragin@jetbrains.com>
Based on #1378 by @nikita-ashihmin: a clean reimplementation on current
`main`, addressed by ACP session cursors instead of message ids.
Supersedes #1378, which can be closed after this merges.
## Summary
A subagent's MCP request waits up to 500 ms for the announcement of the
subagent's child session. When Claude Code closed the request's HTTP
connection during that wait, the adapter kept the request waiting until
the tool use ended or the time passed. It now stops at once.
`@agentclientprotocol/sdk` 2.12.0 gives the HTTP bridge's attribution
resolver the request's `signal`. The signal aborts when the HTTP
connection or the ACP connection closes. `McpOverAcp` ends the wait on
it.
What a request names does not change. The bridge already sent nothing
for an abandoned request.
## Changes
- `@agentclientprotocol/sdk` 2.11.0 to 2.12.0.
- `src/mcp-servers.ts`: the wait for a child session's announcement also
ends when the request's signal aborts.
- `src/tests/mcp-servers.test.ts`: a request that Claude Code gives up
stops waiting and sends nothing.
## Verification
- `npm run check` passes.
- `npm run test:run`: 4,552 tests passed and 53 were skipped.
- The new test fails without the change: the request stays held.
## Summary
A session now starts without its MCP servers when Claude Code refuses to
start with them, and tells the user which servers are missing and why.
With a managed `disableSideloadFlags`, Claude Code takes MCP servers and
plugins only from sources that the administrator approved, and refuses a
start that brings others. A client that passes its MCP servers with
every session, as Zed does, got no session at all on such a machine:
`session/new` failed with `-32603`.
This builds on #1707, which updates the Claude Agent SDK to 0.3.331.
That version names the reason of the refusal
(`sideload_flags_disabled`).
## What changes
- **Claude Code decides.** The adapter reads no policy of its own. It
starts the session as before. When Claude Code refuses the start with
`sideload_flags_disabled` and the session has MCP servers, the adapter
starts it once more without them: `startAroundRefusedMcpServers()` in
`src/mcp-servers.ts`, used by both cores. So a session gets its servers
back at its next start once the setting is gone.
- **The servers are reported as not started**, through the lane that
already reports a server whose endpoint cannot open (`unserved`). They
are the session's ACP servers and the ones of
`_meta.claudeCode.options.mcpServers`.
- **One notice for servers that failed for the same reason.** Each
unserved server got a notice of its own. `mcpServerStartupNotices()` in
`src/session-notices.ts` now gives the servers with the same error one
notice: "3 MCP servers failed to start", with their names and the
reason. A client with eight MCP servers would otherwise get eight equal
warnings in every session. This also covers the `acp` servers of a
connection whose local endpoint cannot open. A notice about one server
is as before.
- **On v2, a resume of the active session keeps those servers out too.**
Such a resume replaces the session's MCP servers on the running query. A
session whose start was refused with MCP servers stays without them
until its query starts again.
- **The MCP-over-ACP bridge hears of no server that the query starts
without** (`sessionStarted`, `toolUseHooks` and `sessionServersChanged`
of #1705).
- **A second refusal is an error, as before.** A client's `plugins` are
refused by the same setting. The session then fails with Claude Code's
text and `data.startupFailureReason`.
## What a client can notice
On a machine with that managed setting:
- `session/new`, `session/load`, `session/resume` and `session/fork`
with MCP servers succeed. The start takes one refused launch of Claude
Code longer.
- With the first turn the client gets the notice (a `notice` on v2 and
for a v1 client with `session.notices`, quoted text for other v1
clients):
> **3 MCP servers failed to start:** The tools of "files", "search" and
"docs" are unavailable in this session. Your organization's managed
settings (disableSideloadFlags) let Claude Code use MCP servers only
from sources that your administrator approved.
- On v1 without `session.notices`, the `_meta.claudeCode` of a notice
about several servers has `servers` (a list) where a notice about one
server has `server`.
Elsewhere nothing changes, but that several servers with the same error
share a notice.
## Testing
- `npm run build`, `npm run check`, `npm run test:run` (4,551 tests
pass)
- Unit tests of the two helpers, and on each core a test that a refused
start is repeated without the MCP servers. On v1 the servers are
unserved, and a start that is still refused fails with its error. On v2
the notice goes out once over two turns, and a resume of the active
session in between sets no servers on the query. They fail without the
change.
- Real CLI: a new test in `v2/v2-integration.test.ts`. A session with
two stdio MCP servers under `managedSettings: { disableSideloadFlags:
true }` starts, answers a Haiku prompt and sends the one notice.
- Real CLI: all of `v2/v2-integration.test.ts` and
`mcp-servers-integration.test.ts` (22 tests pass)
- Real CLI: the whole suite, as `npm run test:integration` runs it (with
`CLAUDE_CODE_ENTRYPOINT` unset): 4,593 tests pass. Two timing tests that
this PR does not touch failed in that run on a loaded machine and pass
by themselves: "holds the requests of two subagents of a v1 session with
child sessions until it knows their announcements went out" in
`mcp-servers-integration.test.ts` (its file passed in 5 of 5 runs
alone), and "absorbs the interrupt's lagged trailer after cancelling a
held turn mid-followup" in `v1/acp-agent.test.ts`.
- Real CLI through the built adapter: `session/new` on v1 and v2 with
MCP servers under that setting, and a Haiku prompt on v1 with and
without `session.notices`. With a client plugin too, the session fails
with "--plugin-dir is disabled by your organization's managed settings
(disableSideloadFlags) …".
## Summary
Updates `@anthropic-ai/claude-agent-sdk` from 0.3.330 to 0.3.331, which
bundles Claude Code 2.1.331. The adapter's code does not change: the
build passes, and no changelog entry needs a change.
Also bumps these dev dependencies: `@anthropic-ai/sdk` 1.12.0 → 1.13.0,
and `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser`
8.73.0 → 8.74.0.
`npm update` brings the in-range lockfile bumps: `brace-expansion`
5.0.13 → 5.1.0, `hono` 4.13.19 → 4.13.21, `pkce-challenge` 5.0.1 → 5.0.2
and `tinybench` 6.2.4 → 6.2.5.
TypeScript stays at 6.0.3: 7.0.2 is out, but `@typescript-eslint/parser`
8.74.0 still requires `typescript <6.1.0`.
## Claude Agent SDK 0.3.331 and Claude Code 2.1.331
Read the SDK changelog for 0.3.331 and the Claude Code changelog for
2.1.331, and compared `sdk.d.ts` and `sdk-tools.d.ts` of 0.3.330 and
0.3.331.
### What a client can notice
- **A clearer error for a start that managed `disableSideloadFlags`
refuses.** On a machine with that managed setting, Claude Code starts no
session that brings MCP servers or plugins of its own, as before. The
failure now has the reason `sideload_flags_disabled`. Through the built
adapter, `session/new` with a client MCP server fails with `-32603`,
Claude Code's own text ("--mcp-config is disabled by your organization's
managed settings (disableSideloadFlags). … Ask your administrator …")
and `data.startupFailureReason`. With 0.3.330 the SDK reported only that
the process exited with code 1. A session without MCP servers and
plugins starts. #1708 starts such a session without its MCP servers.
- **`session/list` on a project with very many sessions.**
`listSessions()` no longer opens every transcript at once, which could
leave sessions out at the open-file limit.
### No change for the adapter
- **Types.** Doc text, the new startup failure reason, and members the
adapter does not use (`soft_error_result`, `registryPolicyFingerprint`,
`downloadsMirrorUrl`).
- **Edit and Write results now say when `canUseTool` changed the text
through `updatedInput`.** The adapter answers with the input it was
asked about. Checked through the built adapter: an approved Edit still
ends with "has been updated successfully".
- **`task_notification.output_file` for a foreground subagent.** The
async task lane of v1 leaves subagent tasks out, and v2 does not read
the field.
- **`rewindFiles()` refuses under a managed `fileCheckpointingEnabled:
false`.** The file change report of such a turn ends `unavailable`, as
for any preview that Claude Code refuses. Read from the code, not
reproduced.
- **Start-up no longer waits for the model list when a session starts
soon after another.** The initialize response lists the same models:
compared for three sessions started together and one right after,
0.3.330 against 0.3.331.
- **SubagentStop hooks wait for the transcript's last reply.** Both
cores use the hook to report a child's configuration only.
- **`getSessionInfo`, `listSessions` and `getSessionMessages`** read a
transcript as before: a differential run of 0.3.330 against 0.3.331 over
4,500 generated transcripts gave no mismatch. The run is not part of
this PR.
- **Compaction summaries that quote XML tags, MCP tool calls that hung
on a malformed reply, a request that went silent while Claude was
thinking.** Fixes of Claude Code, picked up as they are.
## Testing
- `npm run build`, `npm run check`, `npm run test:run` (4,541 tests
pass)
- Real CLI: the whole suite, as `npm run test:integration` runs it (with
`CLAUDE_CODE_ENTRYPOINT` unset): 4,584 tests pass and 9 are skipped (the
live capability audits, the baseline recording, and one test that skips
itself)
- Real CLI through the built adapter, without a prompt: `session/new`
under a managed `disableSideloadFlags` (plain, with an MCP server, with
an agent definition, with a plugin)
- Real CLI through the built adapter: one Haiku prompt that edits a file
behind a permission request
- Real SDK and CLI without a prompt, 0.3.330 against 0.3.331: the
startup refusal and its reason, and the model lists
## Summary
Removes the Markdown code spans from thirteen error messages. Schema
v2.0.0-beta.4 says that the `message` of an error is plain text, and
these messages put a field or capability name in backticks.
## Why only these
I checked every v2 field that the schema marks as plain text against
what the adapter sends for it: tool call and permission titles,
permission option names, elicitation messages and labels, auth method
names, config option names, command names and hints, session and
subagent titles, notices, compaction errors and error messages. Text
that the adapter composes is plain everywhere else. The Glob title
already drops its code spans on v2.
Not changed: text that the adapter passes on from the model, Claude
Code, an MCP server or the user, such as an AskUserQuestion question, a
Bash command in a title, a session title or Claude Code's error text.
The adapter does not rewrite it.
## The messages
All are `-32602` messages:
- `src/v2/agent.ts`: "cwd must be an absolute path" (two forms), "cwd is
not a directory: …", "… with that cwd"
- `src/v2/prompt.ts`: "prompt must hold at least one content block"
- `src/initial-config-options.ts`: "configOptions sets … more than once.
…"
- `src/fork-session.ts`: "… announced with the fork capability, or send
the request without cursorId …"
- `src/providers.ts`: the two `_meta.gateway` messages and the vertex
message
- `src/session-index/service.ts`: the three `_meta.jetbrains.air.list`
messages
The last four files are shared, so a v1 client gets the same text
without the backticks. v1's schema has no rule for it either way, and
one text for both versions needs no switch in each helper.
## Testing
- `npm run build` and `npm run check` pass. `npm run test:run` passed
before the rebase onto #1705 (4,485 tests; one file watcher test of
`v1/session-index.test.ts` failed once on a loaded machine and passed
three times by itself). No test pinned the old text.
## Summary
Sends the ACP session and tool call with the MCP requests that Claude
Code makes to a server the client provides over the ACP connection, in
ACP v1 and v2. Updates `@agentclientprotocol/sdk` from 2.9.1 to 2.11.0,
which adds the fields and the bridge option this uses.
An `mcp/message` request can carry `sessionId` and `toolCallId` since
ACP schema 1.35.0 / 2.0.0-beta.4. A client uses the session to run the
request for the right session, and can reject a request without one. It
uses the tool call to show the tool's own output on the tool call the
agent reports. See the [MCP-over-ACP
RFD](https://agentclientprotocol.com/rfds/mcp-over-acp#session-and-tool-call-attribution).
## How a request is matched
Claude Code makes the MCP request itself, over HTTP, to the SDK's
bridge. The adapter never makes the call, so it cannot pass the values
at call time. That is a Claude Code limitation, and the reason for the
hook:
- A PreToolUse hook records which agent each tool use belongs to before
the tool runs.
- Claude Code sends the same tool-use ID in
`params._meta["claudecode/toolUseId"]` of `tools/call`.
- The bridge's `attribution` resolver looks the record up and names the
session and the tool call. The tool call ID is the tool-use ID, which is
what both cores already report in `session/update`.
The record lives in `McpOverAcp` in `src/mcp-servers.ts`, which owns the
bridge. `src/v1/acp-agent.ts` and `src/v2/agent.ts` only wire it in.
## What is sent
| Who runs the tool | v1, no child sessions | v1, child sessions | v2 |
|---|---|---|---|
| Main conversation | root + tool call | root + tool call | root + tool
call |
| Announced subagent | root + tool call | child + tool call | child +
tool call |
| Subagent not announced yet | root, no tool call | waits up to 500 ms,
then child + tool call | waits up to 500 ms, then child + tool call |
| Workflow agent | root, no tool call | root, no tool call | root, no
tool call |
- **The root is never sent in place of a child.** A v1 client without
child sessions gets the root because the root reports the subagent's
tool calls there.
- **A workflow agent is never exposed as a child,** and the root shows
its work on the Workflow tool call. Its own tool uses are not reported,
so no tool call ID is sent for them.
- **Once a tool call has been reported,** the request names the session
of that report.
- **Nothing is sent** for `server/discover` and `tools/list`, for a tool
use no hook reported, for a server the session's last setup request did
not declare, after the root session closed, and for AIR's draft child
sessions, which are never announced with `subagent_update`.
## Holding a request for an unannounced subagent
A subagent can run a tool a few milliseconds before the adapter has sent
the `subagent_update` that announces its child session. A client that
needs the session could then reject a subagent's first tool call for
that reason alone. So the resolver waits for the announcement, up to
`ANNOUNCEMENT_WAIT_MS` (500 ms), then names the child. In 15 measured
runs the announcement was 1.5 to 12 ms ahead of the request.
- Only a request that can gain from it is held. The main conversation,
workflow agents, announced children, forgotten children, requests
without a tool-use ID, and v1 without child sessions are not delayed.
- The wait also ends when the tool use ends or the session closes. When
the limit passes, the request goes out without attribution.
- It cannot deadlock: the hook answers at once, a pending MCP request
does not stop Claude Code's message stream, and the messages the
announcement depends on are written before the subagent's tool runs.
## Hooks
The PreToolUse, PostToolUse and PostToolUseFailure hooks are only
registered for a session that declares an `acp` server, and only match
those servers' tools (`mcp__(?:<names>)__.*`, with names normalised the
way Claude Code does).
## SDK 2.11.0
Nothing in the update broke the build. One visible change: the bridge
now words a client's rejection for the model. A rejected tool call shows
"The MCP server refused this request before running it. Reason: ...
Changing the tool arguments will not help." The resolver's new
`connection` argument is not used, because each agent app has its own
bridge for its one connection.
## Known limits
- **A server added by a v2 resume to a running query** gets no hook
record, so its requests name no session until the session's next query.
Hooks cannot change on a running query. The adapter logs it and never
names a wrong session.
- **A request Claude Code abandons stays held** until the tool use ends
or the limit passes. The resolver gets no cancellation signal in SDK
2.11.0.
- **Workflow agents are recognised by Claude Code's `agent_type:
"workflow-subagent"`.** If a session defines its own agent with that
name, the child-session modes name nothing for an agent of that type
without an announced child.
- **Agent teams were not examined.** They are treated as an agent the
adapter does not know.
## Tests
- `src/tests/mcp-servers.test.ts`: the record, every attributed and
unattributed case, the hold and its limit, and cleanup.
- `src/tests/v2/acp-v2.test.ts`: router tests for v1 and v2.
- `src/tests/mcp-servers-integration.test.ts`: the bundled CLI with a
scripted local model, gated by `RUN_INTEGRATION_TESTS` like the other
real-CLI tests. A parent and two concurrent subagents call the same tool
with the same arguments, in all three modes. It also covers a workflow
agent, the hold (with an injected delay, since the natural race cannot
be made repeatable), and a client `-32602` producing a failed tool call.
It needs no account.
## Verification
`npm run check`, `npm run build` and `npm run test:run` pass (77 files,
4,541 tests). `RUN_INTEGRATION_TESTS=true npx vitest run
src/tests/mcp-servers-integration.test.ts` passes (10 tests). The rest
of `npm run test:integration` was not run, since it needs an account.
1. **[Prompts during active
work](https://youtrack.jetbrains.com/issue/IJAI-6021).** Deliver
priority prompts while Claude is running and keep the foreground turn
open until those prompts are answered. Withdraw cancelled queued prompts
without interrupting unrelated work, and handle prompt rejection or
completion without ending another prompt's turn.
2. **Work state and session restoration.** Report `running` while a
parallel foreground tool can still progress, even when another tool
awaits input. Preserve active work during resume. Restart the Claude
query for changed workspace roots only at a work boundary, and wait for
that restart before reporting success.
3. **Subagent results.** Publish a child's handback report even when
Claude provides it only in the launch result and sends no separate child
stream. Deduplicate reports and preserve their child-session
association. Restore successful handback reports in the existing Air v1
history view as well.
4. **Question form compatibility.** Keep custom answers attached to
their choices in Air on both protocol versions. Add request-level
`customAnswerFields` because the Kotlin SDK drops property metadata,
while retaining the existing property markers for older clients. Limit
v2 schema conversion to removing unsupported string patterns.
5. **Plan review outcomes.** Report a rejected plan as a cancelled turn.
Keep an accepted plan continuation inside the same foreground lifecycle
when it clears the context, so the interruption does not appear as a
completed answer.
The live cancellation test uses loopback ping to keep a foreground
command active. On systems that deny ICMP socket creation, ping exits
immediately. A terminal announcement can still arrive, and Claude Code
can insert the second prompt before the test cancels it.
Use a shell command that prints a start marker and sleeps. Wait for the
marker in streamed stdout before submitting the second prompt. The test
still requires the queued prompt to fail with `-32800`, the session to
go idle with `cancelled`, and a subsequent prompt to complete normally.
The original test failed and the corrected test passed against Claude
Code on base `184b7df`. On current upstream `4af4581`, `npm run check`
passed and `npm run test:integration -- --maxWorkers=2
src/tests/v2/v2-integration.test.ts` compiled the adapter and passed all
11 tests.
## Related CI failure
The failing Build job hit a flaky ACP v1 subagent announcement test. The
fix is in
[#1700](https://github.com/agentclientprotocol/claude-agent-acp/pull/1700).
---------
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
The ACP v1 worktree-child test sometimes receives two announcements for
the isolated child. The `session/new` setup timer can publish the
current subagent snapshot after the test has already simulated a child
starting. The failing CI run in #1694 received that snapshot in addition
to the two expected announcements.
Wait for the real setup snapshot publication to finish before simulating
either child's start. Keep the existing assertions for both
announcements and their working directories.
On Node 26.13.1 the original test failed 12 times in 80 attempts. The
updated test passed all 80 attempts.
`npm run check`, `npm run build`, and `npm run test:run --
--maxWorkers=2` passed. The full suite reported 4,450 passed and 44
skipped.
Claude Code pipes command output, so a v2 display terminal needs a
carriage return before a bare line feed to start the next line at column
zero. Bash output can also contain CRLF and standalone carriage returns
used for progress updates. The encoder added an extra CR to existing
CRLF.
Convert only bare LF in v2 terminal chunks and snapshots. Track the
preceding CR on each running terminal so CRLF can span two chunks. A
replacement snapshot starts fresh and supplies the trailing character
for the next chunk. This also covers background output, where the
output-file reader can send a snapshot ending in CR and then append a
chunk starting with LF.
The regression test checks mixed line endings, progress updates, empty
chunks, and snapshot replacement. The corresponding Codex fix is
[codex-acp#795](https://github.com/agentclientprotocol/codex-acp/pull/795).
## Summary
The `effort` option lists the levels of the current model only. AIR
cannot show the effort steps and the recommended effort of a model
before that model becomes current. AIR Cloud sessions and Manage Presets
have no correct steps at all.
This PR adds the effort levels of each model to its entry of the `model`
config option:
```json
{ "value": "claude-opus-5-5", "name": "Opus 5.5",
"_meta": { "jetbrains": { "air": { "version": 1,
"reasoningEfforts": { "values": ["low", "medium", "high", "xhigh", "max"], "recommended": "medium" } } } } }
```
## Changes
- `values` are the `supportedEffortLevels` of the SDK `ModelInfo` of the
entry, in the SDK order. They never contain the `default` row of the
effort option.
- `recommended` uses the adapter rule: "medium" when the model offers
it, else the first level. The SDK names no recommended effort per model.
The rule moves into `recommendedEffortLevel()`, and the effort option
uses it too. For the current model, `recommended` is equal to
`recommendedValue` of the effort option.
- A model without effort levels gets no `_meta`. The `default` entry
gets the levels of the listed model that its `resolvedModel` names.
Without such a model, it gets no `_meta`.
- The adapter sends the key to every AIR client. The key only adds data,
so it needs no capability. A client that is not AIR gets no AIR key, as
the Compatibility rule says.
- All config option answers carry the key: new, load, resume, fork,
`session/set_config_option` and `config_option_update`, for ACP v1 and
v2. They all use `buildConfigOptions`.
- Out of scope: subagent `model` options. They have no effort slider.
- `docs/air-extensions.md` documents the key and the capability.
## Tests
- `recommended-config-values.test.ts`: values and order, the
`recommended` rule, a model without efforts, both cases of the `default`
row, and a model that the picker does not list.
- v1: new, set, load, resume, fork, and `config_option_update` after an
external model switch.
- v2: new, set, resume, fork, and the update.
- No golden file changes.
`npm run build`, `npm run check`, `npx vitest run`: pass in a clean
environment.
Tracking: IJAI-6873. AIR consumer: IJAI-5161.
## Summary
Both cores now send the route of a provider, or of a gateway login, to
Claude Code a second time: right after a session starts, with
`applyFlagSettings()`.
The route is already part of the query's `settings` option, in one
object with the client's settings and the model configuration of the
environment. Claude Code loads that object as a whole or not at all: one
value that fails validation leaves all of it out. Since 2.1.330 it says
so in a warning (see #1689). The second delivery does not depend on that
object.
## What changes
- **One place for the route as settings.** `providerRouteSettings()` in
`src/providers.ts` builds it: `apiKeyHelper: ""` and the env of
`createEnvForProvider()`. Both cores built that object on their own
before.
- **`applyProviderRoute()`** in the same module sends it to a running
query. v1 and v2 call it right after the query's initialize response,
before a request of the session reaches the provider. The context read
is such a request: `getContextUsage()` sends `count_tokens`.
- **A session without a provider or gateway login** gets no such call.
- **When Claude Code refuses the call, the session is not started.** The
request fails with `-32603`, "The session was not started, because
Claude Code did not take its provider or gateway route. Try again, or
set the provider or the gateway login again.", and Claude Code's text in
`data.details`. The adapter builds the route itself, and I know no input
that makes Claude Code refuse it.
## What a client can notice
Nothing when its `settings` load. The call then changes nothing: Claude
Code merges `env` key by key, and the values are the ones of the
`settings` option. Recorded with the real CLI: after the call, the flag
settings still hold the client's own `env` keys and its `permissions`.
When a value of its `settings` fails validation, the client's settings
are not in effect, as before. The route of the provider is.
## Testing
- `npm run build`, `npm run check`, `npm run test:run` (4,437 tests
pass)
- Each core has a test that the route is applied (on v1: before the
first context read), and a test that a refused route starts no session
and releases the query. They fail without the change.
- Real CLI: a new test in `v2/v2-integration.test.ts` with two local
servers, so it costs no API usage. One is the provider. The project's
`.claude/settings.json` names the other as `ANTHROPIC_BASE_URL`, and the
client's `settings` hold `permissions.allow: "Bash"`. The session's
model requests reach the provider's server. The test fails without the
change. It passes with Claude Code 2.1.330 and 2.1.328, and with a CLI
named in `CLAUDE_CODE_EXECUTABLE`, which gets its settings in a flag.
- Real CLI through the built adapter, with the same two servers: on v1
and on v2, with valid and with invalid client `settings`, every model
request reaches the provider's server.
- Real CLI: the whole suite, as `npm run test:integration` runs it (with
`CLAUDE_CODE_ENTRYPOINT` unset): 4,470 tests pass and 9 are skipped (the
live capability audits, the baseline recording, and one test that skips
itself)
## Summary
Updates `@anthropic-ai/claude-agent-sdk` from 0.3.328 to 0.3.330, which
bundles Claude Code 2.1.330. The adapter's code does not change: the
build passes, and no changelog entry needs a change.
Also bumps the dev dependency `@anthropic-ai/sdk` 1.10.0 → 1.12.0.
`npm update` brings the in-range lockfile bumps: `@babel/runtime`
7.29.14 → 7.29.15, `@hono/node-server` 2.1.9 → 2.1.11 and
`source-map-js` 1.2.3 → 1.2.4.
TypeScript stays at 6.0.3: 7.0.2 is out, but `@typescript-eslint/parser`
8.73.0 still requires `typescript <6.1.0`.
## Changelog review
Read the SDK changelog for 0.3.329 and 0.3.330 and the Claude Code
changelog for 2.1.329 and 2.1.330, and compared `sdk.d.ts` and
`sdk-tools.d.ts` of 0.3.328 and 0.3.330.
### What a client can notice
- **A warning when settings do not load** (0.3.330). When a value in a
session's `settings` or in a settings file fails validation, Claude Code
leaves the whole object or file out, as before. It now says so in the
session's first turn, in an `informational` message at level `warning`
(tag `settings_not_in_effect`). Both cores pass such a message on: as a
`notice` with `severity: "warning"` on v2 and for a v1 client with
`session.notices`, as quoted `**Warning:**` text for other v1 clients.
Checked through the built adapter, see Testing.
- **A warning when the hooks of managed settings do not load** (0.3.329,
tag `managed_hooks_not_loaded`). The same kind of message, passed on the
same way. Not reproduced: it needs managed settings.
- **The Fast mode state of a new session is that of its model.** The
initialize response's `fast_mode_state` described the default model, and
both cores set the Fast mode option of a new session from it. Recorded
with `settings: { model: "haiku", fastMode: true }`: `on` with 0.3.328,
`off` with 0.3.330.
- **A login that the macOS Keychain cannot save** ends a request with
`invalid_request` and no status, not with `authentication_failed` and
401. The adapter then fails the prompt with Claude Code's text ("… can't
save to the Keychain …") and no longer asks the client to sign in again.
Read from the changelogs and the CLI's text, not reproduced.
- **Prompt suggestions.** Claude Code now drops a placeholder such as
`_(no suggestion)_` where it generates the suggestion, so the adapter's
suggestion updates do not carry one.
- **claude.ai connectors are in the server list of `system/init` at
once.** Before, the list was empty at start and they came later. The
startup notices of both cores cover the client's own MCP servers only,
so a client gets no new notice.
### No change for the adapter
- **Types.** Doc text, plus:
- two `Settings` keys, `permissions.workingDirectoriesExclude` and
`desktopMcpServersListScope`
- the subkind `external-event` of a `task-notification` origin, which
only a session server stamps
- `maxAgeMs` and `otherOneShots` on the output of `CronCreate`
- **`query()` refuses a `settings` JSON string that does not parse**,
when the `sandbox` option is set. The adapter passes no string: it reads
a client's settings file itself and passes an object.
- **Request ids of SDK MCP servers.** The adapter starts none.
- **`rewind_conversation` and `SpareProcess.claim()`.** Not used.
- **Background agents.** A stopped agent stays stopped, and Claude no
longer waits for an agent that `stopTask()` stopped as it finished.
Picked up as they are.
- **The system prompt after a model change that follows a context read,
and the memory use of idle sessions.** Picked up as they are.
- **The shorter sign-in link.** The adapter runs `claude auth login` in
the client's terminal and reads no link.
- **`getSessionInfo`, `listSessions` and `getSessionMessages`** read a
transcript as before: a differential run of 0.3.328 against 0.3.330 over
4,500 generated transcripts gave no mismatch. The run is not part of
this PR.
- **`@anthropic-ai/sdk` 1.11.0 and 1.12.0.** The adapter uses its types
only. The releases add Admin API methods and an error code, and fix the
client's default headers.
## Testing
- `npm run build`, `npm run check`, `npm run test:run` (4,434 tests
pass), on `main` with #1690
- Real CLI: the whole suite, as `npm run test:integration` runs it (with
`CLAUDE_CODE_ENTRYPOINT` unset). Before #1690 landed, the run passed in
full: 4,465 tests pass and 9 are skipped (the live capability audits,
the baseline recording, and one test that skips itself). On `main` with
#1690, on a machine under heavy load, 4,460 pass; one timing test of
`v1/acp-agent.test.ts` failed, and the 10-second build hook of the v1
subprocess tests timed out, which skipped those five. All six pass when
run again by themselves.
- Real CLI through the built adapter: one Haiku prompt in a session
whose client `settings` hold `permissions.allow: "nope"`. On v1 without
`session.notices` the warning is quoted text, on v1 with it and on v2 it
is a `notice`. Each time it comes inside the turn, before the answer.
- Real SDK and CLI without a prompt, 0.3.328 against 0.3.330: the Fast
mode state per model, the settings read for valid and invalid settings,
and the MCP server list at start
Updates `@agentclientprotocol/sdk` from 2.9.0 to 2.9.1 (schema
v2.0.0-beta.3). The release has two changes, and both come from the
review for #1687.
## A relative stdio MCP `command` is rejected on v2
ACP v2 requires the `command` of a stdio MCP server to be an absolute
path, and an Agent rejects a relative one with `-32602`. SDK 2.9.1 does
that in `assertSupportedMcpServers`
(agentclientprotocol/typescript-sdk#361), which the adapter already
calls for `session/new`, `session/resume` and `session/fork` on v2. So
this needs no adapter code.
A v2 client that sends a bare command name, such as `npx`, now gets
`-32602` with `{ name, command }` before anything is created, resumed or
copied. It has to send the full path. v1 does not require an absolute
path and is unchanged.
The SDK accepts a path that is absolute in POSIX or in Windows syntax,
because it does not know which machine the Agent runs on. A path in the
other system's syntax passes the check and fails when Claude Code starts
the server, like any missing executable.
- The existing test of rejected MCP server lists is now an `it.each`
with the relative `command` as a second case, over new, resume with and
without replay, and fork.
- The doc comment of `v1McpServers` and the README's v2 section say it.
## Markdown in descriptions
The schema change is description text only: the `description` of an
authentication method, a command, a config option and each of its
values, a permission request and a subagent may contain Markdown on v2
(agentclientprotocol/agent-client-protocol#2974). The adapter already
sends Markdown in some of them, such as the remote login method's ``Run
`claude /login` in the terminal``, so nothing changes.
## Tests
`npm run build`, `npm run check` and `npm run test:run` pass (4,434
tests).
Against the real Claude Code CLI, the whole suite ran with 4,461 passed
and one suite not run: the `tsc` step in the `beforeAll` of "ACP
subprocess integration" hit its 10 second limit twice, on a machine with
a load average above 50. That suite's five tests pass when it runs
alone.
A session that is loaded or resumed while it runs keeps its subagents'
runs. A child that works then, and that the request's replay does not
announce, was not reported as the protocol asks, on v1 or v2. A forked
skill's child is one such child: its metadata names no launch call, so
no replay has it. A subagent launched after the stored history was
written is another.
Found while reviewing the protocol changes since ACP SDK 2.8.0. One
commit per protocol version.
## v2: `session/resume` with replay of the active session
The rules, from the session setup and subagents pages:
- "The Agent **MUST** send `replay_complete` exactly once on each child
session that it announces with `subagent_update` between the request and
the response… An announced child with no replayed history gets one too."
- "The Agent **MUST** send the announcing `subagent_update` before any
request or notification that carries the child's `sessionId`", and "The
announcement rule applies again on every resume".
- "The Agent sends current updates for a child after that child's
marker."
Before, with a forked skill's child running and one of its messages sent
while the history was read:
```
root replay_complete
child agent_message_chunk <- held update, before any announcement in this resume
root subagent_update <- from the state snapshot
child state_update
root state_update
```
The child never got a `replay_complete`, and its held update came before
its announcement.
After:
```
root replay_complete
root subagent_update <- labels and the cancel capability
child replay_complete
child agent_message_chunk
root subagent_update running
child state_update running
root state_update
```
Right after the root's `replay_complete`, in the same synchronous replay
step, each current child that the replay did not announce is announced
again on its parent and gets its own `replay_complete`. What the replay
held follows, then the snapshot. A child counts as current when it
works, when its parent lists it, or when the replay holds something its
session sent, such as the end of a run that ended while the history was
read.
`SessionTasks.unreplayedChildren` builds these updates, and
`ReplayHolds` now records which sessions sent what it holds. A child
whose launch is in the history was already handled and is unchanged.
## v1: `session/load` or `session/resume` of the active session
The rules, from the v1 subagents page:
- "When the Client sends `session/load` or `session/resume` for a
session, it **MUST** discard the state and capabilities it holds for
that session's children."
- "The Client **MUST NOT** send `session/cancel` for a child until the
request succeeds and a current `subagent_update` advertises `cancel`."
- "The Agent **SHOULD** report each child's current state when it can
determine it."
Before, the adapter reported only the children that a load's replay had
announced. A working child of a resumed session, which replays nothing,
got no `subagent_update` after the response. Nor did a working child
whose launch a loaded history does not have. A conforming client could
no longer cancel either one.
After, each working child that no replay announced is announced again on
its parent after the response, with its labels, `cwd`, `capabilities: {
cancel: {} }` and its state, and then gets the configuration that the
client last had for it. A child that no longer works but has a working
child of its own is named first, with its labels only, so parents come
before children.
`NativeSubagentRuntime.currentChildren` builds these, and
`publishCurrentSubagentStates` sends them after the replayed children's
current states. AIR's draft form is unchanged.
## Tests
- v2 (`src/tests/v2/v2.test.ts`): one `it.each` with three cases, a
forked skill's child that reports during the resume, a quiet subagent,
and a subagent whose run ends during the resume.
- v1: a runtime test in `src/tests/native-subagents.test.ts` (a nested
working child under an ended parent, a `requires_action` child with its
own `cwd`, an ended child, a child the replay covers, and the
configuration), an `it.each` over resume and load of the active session
in `src/tests/v1/create-session-options.test.ts`, and a working child
that the replay lacks in the existing load test.
Each new case fails without its source change. `npm run build`, `npm run
check` and `npm run test:run` pass, and so does the whole suite against
the real Claude Code CLI (4,465 passed, 9 skipped).
## Not covered
- v2: a child that is first announced between the root's
`replay_complete` and the response still gets no marker. The window is a
few awaits long.
- v2: an unreplayed live child's configuration is not sent again after
its marker.
- v1 has no hold, so a working child's own updates can still reach the
client between the request and this announcement. The change restores
the child's capabilities, state and configuration after the response,
not that order.
- v1 covers working children only, as the v2 snapshot does.
## Not verified
The tests drive the frames that Claude Code is known to send for a
forked skill, but no live session was resumed while one ran. Two things
only a live run shows: the real timing of a forked skill's frames during
a resume, and whether the stored history of an active session already
has a launch that was just made.
A child session that a `session/load` or `session/resume` replay
announced was known only to the replay. A request that named it was
answered as one of an unknown session: `session/close` and
`session/delete` reported success, and the rest failed with `-32002`. A
live child was forgotten the same way after `/clear` and after a restart
of its root's query.
Found while reviewing the protocol changes since ACP SDK 2.8.0
(agentclientprotocol/agent-client-protocol#2952).
## The rules
- Errors page, v1 and v2: "A child session that the Agent announced with
`subagent_update` is not an unknown session… Agents **SHOULD** reject
any other request that names a child with `-32602`."
- v2 session setup: "Agents **SHOULD** reject a `session/close` that
names one with `-32602`." The delete page says the same for
`session/delete`.
- Subagents, restricted methods: the Client can name a child from the
child's announcement until the child's root session stops being active.
## Before
- v2: `V2Agent.ownerOfChild` asked `SessionTasks.hasChild`, which reads
only the children of the current conversation.
- v1: `assertNoChildSession` asked `NativeSubagentRuntime.hasChild`,
which reads only live children.
## After
Each connection keeps one record of the child sessions it announced,
`AnnouncedChildren` in `src/acp-subagents.ts`. It takes the child of
every `subagent_update` at the point where updates go out
(`V2Agent.send` on v2, `ChangedMetaClient` on v1), and forgets a root's
children when the client ends that root.
A request that names such a child now fails with `-32602` through the
existing `restrictedChild`, on v1 and v2. `session/cancel` of a child
that does not run still does nothing. On v2, `tool_call/cancel` and
`terminal/cancel` answer `-32602` for it, also after its root's query
ended (it was `-32002`).
The record is per connection and not per session because per-session
state does not last long enough. On v1 a load's replay runs before the
session record and its runtime exist. On both versions a query restart
creates a new session object, and `/clear` drops the live children,
while the client still holds every child it was told about.
Other changes that follow from it:
- v1: a new `endSession` (teardown plus forgetting the children) serves
`session/close`, `session/delete` and archive. A load or resume that
replaces the query still only tears down, and keeps the children.
- v2: a replayed child's own updates are now held while a second replay
of its root is in flight, like the parent's `subagent_update` for it.
Before, the child's state could overtake its announcement.
- `NativeSubagentRuntime.hasChild` had no caller left and is removed.
`SessionTasks.hasChild` is private and documented as live-only.
- AIR's draft announces with `subagent_spawned` and keeps its own rules,
so its children are never in the record, as before.
`docs/subagent-sessions.md` says which children are covered and for how
long.
## Tests
- `src/tests/acp-subagents.test.ts` covers the record.
- v1: the existing `it.each` over the methods now announces through the
agent's client. New cases: a child from a live run, a child from a load
replay with no session record (forgotten after close), and a child kept
when a resume recreates the session.
- v2: the `it.each` gains a row after a conversation reset. New cases: a
replay-only child (close, cancel as a no-op, item cancel while the root
runs and after its query ended, `-32002` after the root closes), and a
child across a provider restart.
`npm run build`, `npm run check` and `npm run test:run` pass. The whole
suite also passes against the real Claude Code CLI on this branch merged
with the SDK 2.9.0 bump and the other replay fix (4,459 passed, 9
skipped).
## Not verified
- v1 delete and archive forgetting is covered only through
`closeSession`. They share `endSession`.
- Three paths leave an entry until the connection ends: a root whose
process died without a close, a v2 resume that fails after its replay
announced children, and a `subagent_update` sent after a close. The only
effect is `-32602` instead of not-found for an id that is invalid either
way.
A child session's `config_option_update` inside a replay describes a
past value. Both replays sent each child's `model` option inside the
replay, and then dropped the update after the replay when it was the
same. A client that follows the ACP rules never got a configuration it
may show.
Found while reviewing the protocol changes since ACP SDK 2.8.0
(agentclientprotocol/agent-client-protocol#2881 and
agentclientprotocol/agent-client-protocol#2896).
## The rules
- v2, Replay contents: "Historical `usage_update`,
`session_info_update`, `config_option_update`, and
`available_commands_update` notifications. They describe past values and
**SHOULD NOT** be replayed."
- v2, Subagents: "Agents **SHOULD** send a current
`config_option_update` for a restored child when it is available."
- v1, Subagents: "A child's `config_option_update` that arrives before
the `session/load` response is historical. The Client **MUST NOT**
present it, or configuration it held before the load or resume, as the
child's confirmed current configuration. Agents **SHOULD** send a
current `config_option_update` for a restored child when it is
available. After `session/load`, they send it after the response."
## Before
- v2 (`src/v2/subagent-replay.ts`): the child's `model` went out as a
`config_option_update` at its announcement, and again for each response
with another model. After the root's `replay_complete`, the current
configuration was skipped when it equalled what the replay sent.
- v1 (`src/subagent-replay.ts`): the same during the `session/load`
replay, and `currentStates` dropped the update after the response when
it equalled the replayed one.
## After
Both versions behave the same way:
- The replay sends no `config_option_update` of a child. It only tracks
the model of the child's latest response.
- After the boundary, each announced child gets one
`config_option_update` when a configuration is known: the configuration
of a child that still runs, else its `model` option with the model of
the latest response in its transcript, as the session's model list names
it. It goes out also when nothing changed.
- The boundary is the root's `replay_complete` on v2 and the load
response on v1.
On a child's own stream on v2 the order is now: history,
`replay_complete`, `state_update`, `config_option_update`. On v1, after
the load response: the parent's `subagent_update`, then the child's
`config_option_update`.
`currentChildConfiguration` and `trackResponseModel` in
`src/subagent-replay.ts` serve both cores. The replayed-model state that
only the dedupe needed is gone (`ReplayChild.model`, `mapsDuringReplay`,
`sendModel`, `firstResponseModel`). AIR's draft form
(`publishReplayedChildModels`) is unchanged.
One thing goes slightly beyond the spec: a child that no longer runs
still gets its model after the boundary. The SHOULD names a "restored
child". `currentStates` already did this when the model list mapped the
model to another entry, and a client has no other way to learn which
model a past child ran on.
## Tests
- v1 (`src/tests/v1/acp-agent.test.ts`): one replay with four children
covers no model before the response, the latest response's model mapped
by the model list, an unlisted model sent as its id, a `<synthetic>`
response ignored, none for a child without responses, and a live child
getting its live configuration.
- v2 (`src/tests/v2/acp-v2.test.ts`): the history test pins the
configuration after the child's `replay_complete` and state. The
live-child test expects the live configuration once. An `it.each` covers
the latest of two response models and no update without a response.
`npm run build`, `npm run check` and `npm run test:run` pass. The whole
suite also passes against the real Claude Code CLI on this branch merged
with the SDK 2.9.0 bump and the other replay fix (4,459 passed, 9
skipped).
## Not verified
No real client's rendering of a child's model that arrives after the
boundary was checked.
Updates `@agentclientprotocol/sdk` from 2.8.0 to 2.9.0 (schema v1.34.1
and v2.0.0-beta.2), and follows the protocol rules that changed for what
the adapter already serves.
The adapter compiles against 2.9.0 unchanged. The behavior rules are in
the protocol docs, so I read the protocol repo from the last reviewed
commit to `schema-v2.0.0-beta.2`, which is 90 commits.
Each change below is its own commit.
## Changes
### The bump
- SDK 2.9.0 dispatches one incoming message per event-loop task, in the
order received. Two v2 tests asserted a `running` state right after a
permission answer, before the in-process test client had read it. They
now wait for it. The adapter sends that update before it returns the
decision, as before.
- ACP made plan operations and subagent sessions stable in v1 and moved
v2 to Preview. The adapter already serves them as specified, so only
words change: the README section is "ACP v2 (Preview)", the subagent
docs link the protocol page instead of the RFD, and comments no longer
say "draft".
- The README says how long the `idempotencyKey` of a prompt that Claude
Code does not store is known: until `session/close` or the end of the
connection.
### The text items of a v2 tool call stay apart
v2 now says that adjacent text blocks form one continuous text, which a
Client joins without a separator
(agentclientprotocol/agent-client-protocol#2885). The adapter's text
items in a tool call's content are separate paragraphs: one per
AskUserQuestion question, per reported finding, or per block of a tool
result. Joined, two fenced error blocks would run into each other.
`v2ToolCallPatch` in `src/v2/tool-call.ts` now ends each text item that
another text item follows with a blank line. v1 is unchanged.
### A v2 Glob title is plain text
v2 now says that a tool call `title` is plain text, which a Client
should not render as Markdown
(agentclientprotocol/agent-client-protocol#2887). A Glob title wrapped
its path and pattern in backticks, which such a Client shows literally.
A v2 client gets them as they are. v1 states no format, so a v1 client
keeps the code spans.
### An empty `systemPrompt.content` is rejected on v1 too
A Client must not send an empty `content` list, and an Agent may reject
one with `-32602` (agentclientprotocol/agent-client-protocol#2912). SDK
2.9.0 rejects it on v2 in the schema. On v1 it reached the session. With
`override`, Claude Code then got an empty custom prompt, which is also
what the Claude Agent SDK sends when its `systemPrompt` option is
omitted.
`clientSystemPrompt` now rejects it, so both versions answer the same.
This is a behavior change for a v1 client that sent `content: []`.
### A stale usage origin is removed (v2)
The top-level `_meta` of a v2 `usage_update` is now a metadata patch: a
Client keeps each key until an update replaces it or sets it to `null`
(agentclientprotocol/agent-client-protocol#2933). `_claude/origin` went
only with a result that had an origin, so a Client kept `{ kind:
"task-notification" }` for every later result.
The next result without an origin now sends `"_claude/origin": null`.
`_claude/model` and `_claude/rateLimit` are the last ones reported,
which is what a Client keeping them means.
## Already compliant, checked
- Cancellation: a prompt that came before a `session/cancel` and is not
inserted gets `-32800`, a prompt after it is held and not rejected, the
cancelled work's final updates come before its `idle` with `cancelled`,
and listed background work keeps running.
- Permissions: the `optionId` is matched against the options offered,
and an unknown option or outcome, an error response and a withdrawn
request all leave the tool unapproved.
- `replay_complete`: the hold starts with the request, each replayed
child gets its own marker, and the children's current states follow the
root's marker.
- `idempotencyKey`: a stored message keeps its key across restarts, and
an error leaves the key unused.
- An MCP server that fails to start does not fail the session. The user
gets a notice.
- A prompt with a content type the adapter did not advertise gets
`-32602` before it is inserted.
- Plan operations and subagent updates go to a v1 client only when it
advertises `plan` or `subagents`, and to every v2 client.
- `status` is a patch field on a v2 `compaction_update` now. The adapter
still sends it on every update.
- Elicitations are session-scoped and carry no `requestId`, which the
new scope validators require.
- The SDK no longer answers `tool_call/cancel` and `terminal/cancel` by
default. The adapter has its own handlers.
- The v1 `auth/status` response passes the response validation that SDK
clients now run.
## Not covered
- **Relative stdio MCP `command` on v2.** v2 asks an Agent to reject one
with `-32602`. The check belongs in the SDK's
`assertSupportedMcpServers`: agentclientprotocol/typescript-sdk#361. The
adapter gets it with the SDK release that has it, and a test case for it
is ready.
- **Markdown in descriptions.**
agentclientprotocol/agent-client-protocol#2974 lets several
`description` fields contain Markdown. The remote login method's
description keeps its code span.
- **Replayed subagents.** #1685 sends a replayed child's configuration
after the replay, and #1686 answers requests that name a replayed child
with `-32602`.
- **Relayed MCP forms.** A form with an empty `enum`, `oneOf` or `anyOf`
goes to a v2 client as the MCP server sent it. Only a non-conforming
server sends one, and the Client's `-32602` already ends in `cancel` for
the server.
- **A cancel during an open turn** reports `cancelled` also when Claude
Code's result was not aborted. v2 now says that the stop reason of work
that had already ended stands.
- Still open from earlier bumps: a Markdown plan's `path`, and v2
skills.
## Tests
`npm run build`, `npm run check` and `npm run test:run` pass (4,417
tests). The whole suite also passes against the real Claude Code CLI on
this branch merged with #1685 and #1686 (4,459 passed, 9 skipped).
The [Session options
RFD](https://agentclientprotocol.com/rfds/session-options) says that
querying an existing session should report what restoring it in the
requested workspace would return, without changing that session. On v1
the query always returned the held session’s options. Changing
`additionalDirectories` could therefore show Haiku in the picker even
though `session/resume` with the same directories returned Sonnet.
`session/options` now makes the same reuse decision as `session/load`
and `session/resume`. When the workspace matches, it answers from the
live session without launching Claude Code. When it differs, it reads
the options through a non-persisting query and leaves the live query
running. The probe keeps the live permission mode, starts no configured
MCP servers, and does not attach the adapter’s session-update hooks.
Claude Code has no transcript until the first prompt, so for a held but
unprompted session the probe can fall back to a fresh query without
claiming the held session’s ID. An unknown ID still returns `-32002`.
## Verification
- Added regression coverage for held sessions with and without a stored
conversation. The changed-workspace cases failed before the fix. Also
covered the no-query path when the held session has MCP servers and a
system prompt, neither of which `session/options` accepts.
- `npm run build` and `npm run check` passed. Adapter test suite: 4,414
passed, 41 skipped; the focused v1 options suite passed with the final
assertions.
- Exercised v1 over stdio with the bundled Claude Code binary and a
local Messages API stub. For both a saved conversation and an unprompted
one, the live session stayed on `opus`; the preview for the changed
roots and subsequent resume both returned `default`. The preview left
`session/list` and the transcript files unchanged.
With `--hide-claude-auth`, clients could see `authenticated` for a
subscription the adapter would refuse at `session/new`. On ACP v1 and
v2, `auth/status` and `auth/status_update` now report `unauthenticated`
with no accounts when the stored subscription cannot be used. Enterprise
subscriptions, API keys and setup tokens remain usable.
Keep the legacy `_auth/status_update` payload separate: it still
describes the stored identity, including a refused subscription. Each
notification is sent only when its own payload changes. No login or
billing policy changes.
**Validation:** `npm run check`, `npm run build`, and `npm run test:run`
passed (4,412 tests). A stdio check with a simulated Max login verified
the query and notification on v1 and v2.
## Problem
A forked skill (`context: fork`, such as `/code-review`) runs as a
subagent that no Agent or Task call launched. The adapter ties a
subagent's messages to its child session through that call, so a client
with subagent sessions got an empty child:
- **The user types `/code-review`:** the child was announced with its
prompt, then went `idle`. On v2 the fork's tool calls landed on the root
session; on v1 they were never sent.
- **Claude calls the Skill tool:** no child was announced, and the
fork's tool calls were never sent.
What Claude Code 2.1.328 sends, captured from its output stream:
| | Skill tool | Typed |
| --- | --- | --- |
| `task_started` names a tool call | yes, the Skill call | no |
| `parent_tool_use_id` of the fork's messages | the Skill call's id |
`forked-command-<skill>`, the same for every run |
| `agent_id` of the fork's messages | the task id | the task id |
| When the messages come | live | together, after the
`task_notification` and before the turn's result |
## Change
1. **Route by `agent_id`.** A message whose `parent_tool_use_id` names
no launch call goes to the child that its `agent_id` names.
2. **Announce a Skill-launched child** on the session that made the
Skill call. The call stays a tool call, and the skill's prompt is a
`session_message` in the child only.
3. **Hold the child's end until its messages came,** so its `idle`
follows its tool calls and text. The end is reported at the first
message of the main conversation after one of the child's, at the turn's
result, at Claude Code's `idle`, or when the turn or the query ends.
Both cores apply the same two rules, `endWaitsForMessages` and
`endsMessageWait` in `src/native-subagents.ts`. AIR gets the change
through the v1 runtime; I could not check it against an AIR client.
## Workarounds for Claude Code's behavior
- **The hold is a heuristic.** No task event marks a typed fork. The
adapter holds the end of every foreground subagent that no tool call
launched, and reports it when the turn ends at the latest.
- **`messageCame` returns a promise only when it reports an end.** The
v1 loop calls it for every message, and an `await` on each one let a
cancel run between a message and its handling.
## What a client gets
- **Typed:** the child stays `running` until the command ends, then gets
its tool calls and text together, then `idle`. Claude Code writes the
fork's messages only then, so the transcript is not live.
- **Skill tool:** the child's work is live. The Skill call carries the
RFD's `session` reference on an update with content, such as a failed
result.
- **A subagent that a typed skill launches** gets no session: Claude
Code reports the end of its task before the Agent call that launched it.
That call is a tool call of the skill's child.
- **`session/cancel` of the root:** a typed skill's messages are the
output of stopped work, which the adapter drops. The child reports
`idle` with `cancelled`.
- **`session/cancel` of the child:** its messages still go to it, before
its `idle` with `cancelled`.
- **Replay:** no child for a forked skill. The Skill call stays a tool
call.
`docs/subagent-sessions.md` and the AIR section of
`docs/air-extensions.md` describe this.
## Testing
- Against the real CLI (2.1.328, Haiku), on v2 and on v1 with
`clientCapabilities.subagents`: a typed skill, a typed skill that
launches a subagent, a Skill call, a cancel of the root, and a cancel of
the child.
- New unit tests for the v2 core, the v1 agent and the shared runtime,
built from the captured frames. They fail without the change.
- A new integration case (`v2-integration.test.ts`) runs a typed forked
skill against the real CLI. It fails without the `agent_id` routing.
- `npm run build`, `npm run check`, and the whole suite against the real
CLI (`RUN_INTEGRATION_TESTS=true`): 4440 passed, 9 skipped. An earlier
run had one failure, a temp-directory cleanup race (`ENOTEMPTY`) in
`acp-agent-settings.test.ts`, which passed on three reruns.
ACP clients use the tool-call `title` for display. The adapter used to
copy the raw Claude tool name into that field, so users saw
`mcp__github__create_issue` on tool calls and permission requests.
Send `github: create_issue` as the `title` and keep
`mcp__github__create_issue` as the programmatic `name`. Both ACP v1 and
v2 use the same parser that supplies AIR's structured MCP metadata. It
preserves any `__` inside the tool portion and leaves incomplete MCP
names as they were.
**Verification:** `npm run build` and `npm run check` passed. The
targeted tool-call, permission, and ACP v1/v2 scenario suites passed
(1,586 tests passed, 11 skipped).
Fixes#1670.
## Problem
The Agent picker is meant to show only when the user has custom agents.
It showed with none, listing `web-fetch` as if it were one.
`supportedAgents()` returns Claude Code's built-in subagents together
with the custom ones, and `AgentInfo` does not say which is which, so
the adapter filters the built-ins by name (`BUILTIN_AGENT_NAMES`).
Claude Code lists two built-ins that the set did not name:
- `web-fetch`: listed where Claude Code's staged rollout turns it on, or
with `CLAUDE_CODE_WEB_FETCH_AGENT=1`.
- `claude-code-guide`: listed where the adapter's environment already
sets `CLAUDE_CODE_ENTRYPOINT`. The SDK sets `sdk-ts` only when the
variable is unset, and Claude Code leaves the agent out for that value.
The roster integration test (`src/tests/agent-discovery.test.ts`) exists
to catch this drift. It did not, because neither agent is in the roster
of an account outside the rollout that runs the test from a plain shell.
## Change
- Add `web-fetch` and `claude-code-guide` to `BUILTIN_AGENT_NAMES`. This
covers v1 and v2: both build the picker from the same set.
- The roster test sets `CLAUDE_CODE_WEB_FETCH_AGENT=1` and its own
`CLAUDE_CODE_ENTRYPOINT`, so the roster it compares against no longer
depends on the account or on the shell.
## Why the list is still hard-coded
The issue asks to derive the built-ins from the SDK. The only SDK
surface that separates them is `getContextUsage().agents`, which lists
the agents that are not built in. Session setup deliberately does not
wait for `getContextUsage` (see `readContextWindow` and the "does not
wait for getContextUsage during session creation" tests), so the picker
cannot be built from it without putting that request back on the
`session/new` and `session/load` path. A built-in behind a future
rollout can therefore still leak until it is added to the set and to the
test.
## Testing
- With CLI 2.1.328 and `CLAUDE_CODE_WEB_FETCH_AGENT=1`,
`supportedAgents()` reports `web-fetch` with no custom agents
configured, as in the issue. With a preset `CLAUDE_CODE_ENTRYPOINT` it
reports `claude-code-guide`.
- Both the roster test and the `discoverCustomAgents` unit test fail on
the old set and pass with the new one.
- `npm run build`, `npm run check`, and the whole suite against the real
CLI (`RUN_INTEGRATION_TESTS=true`): 4406 passed, 9 skipped.
## Summary
The adapter now sends a session's `settings` to Claude Code over stdin,
in the SDK's initialize request, as it has done for MCP servers since
#1647. They went in the `--settings` flag before.
Builds on #1668, which updated the SDK to 0.3.328.
## What changes
`cliDelivery()` in `src/claude-cli.ts` replaces `mcpServersDelivery()`.
It returns the SDK options `mcpServersDelivery` and `settingsDelivery`
together, because one rule decides both:
- **The CLI that the adapter ships** gets MCP servers and settings over
stdin: `'initialize'`. Claude Code is then started with
`--await-initialize --initialize-fields=settings` and without
`--settings`.
- **A CLI that `CLAUDE_CODE_EXECUTABLE` names** gets both in flags as
before: `'argv'`. Its version is not known, and an older one fails the
session at startup. Checked with 2.1.323: "unknown option
'--initialize-fields=settings'".
- **Settings stay in the flag when the client's `extraArgs` hold
`settings` or `sdk-url`.** With `settings` there, Claude Code refuses to
start with both ("--initialize-fields=settings cannot be used with
--settings"), and in the flag the `settings` option replaces that
argument, as before. A session with `sdk-url` cannot read the initialize
request at launch, which is why the SDK sends its MCP servers in the
flag too.
Both cores set the two options before the client's options, so a
client's own `mcpServersDelivery` or `settingsDelivery` wins.
The settings in question are the ones the adapter passes as the SDK's
`settings` option: a client's `_meta.claudeCode.options.settings`, the
model configuration of the environment, and the route of a provider or
gateway. A `settings` value that is a file path stays in the flag: the
SDK only sends an object over stdin.
## `settingsDelivery` is not in the SDK's types
SDK 0.3.328 reads `settingsDelivery`, but `sdk.d.ts` does not declare it
and the changelog does not name it. The SDK version is pinned, and no
cast is needed: the options are spread into the query's options.
Nothing fails to compile if a later SDK drops the option. For that case
the v2 integration tests have a new test against the real CLI: it starts
a session with settings, and checks that Claude Code was started with
`--initialize-fields=settings` and that no command line holds the
settings' value.
## Delivery tests in `npm run test:integration`
Each core has a test that expects `'argv'` for the MCP servers and one
for the settings ("sends MCP servers as the CLI takes them", "sends
settings as the CLI takes them"). They now set `CLAUDE_CODE_EXECUTABLE`
themselves.
Before, they relied on the value that `vitest.config.ts` sets for unit
runs only. In `npm run test:integration` the variable is unset, the
adapter's own CLI gets `'initialize'`, and the tests failed. On `main`,
the MCP servers test fails in that run on both cores since #1647. This
PR fixes it.
## Checked against the real CLI
Through the built adapter, on v1 and on v2, without API usage:
| Session | Started with | Result |
| --- | --- | --- |
| A client's `settings` | `--await-initialize
--initialize-fields=settings` | the session starts |
| The same, with the client's `settingsDelivery: 'argv'` | `--settings`
| the session starts |
| A provider with a header (`providers/set`, a local stand-in gateway) |
`--await-initialize --initialize-fields=settings` | the session's model
request reaches the gateway, with the provider's header |
With the SDK alone:
- The settings land in the same layer as before (`flagSettings` in
`getSettings()`), and they survive `applyFlagSettings()` calls for
effort and Fast mode.
- Without a `settings` option, nothing changes in the launch flags.
## Testing
- `npm run build`, `npm run check`, `npm run test:run` (4,375 tests
pass)
- Real CLI: the whole suite, as `npm run test:integration` runs it (with
`CLAUDE_CODE_ENTRYPOINT` unset): 4,406 tests pass and 9 are skipped (the
live capability audits, the baseline recording, and one test that skips
itself). With `CLAUDE_CODE_EXECUTABLE` set, the new integration test is
skipped.
- Real CLI: the probes above
## Summary
Updates `@anthropic-ai/claude-agent-sdk` from 0.3.326 to 0.3.328, which
bundles Claude Code 2.1.328. The new version needs one adapter fix,
included here: a session's settings are released when the SDK refuses
the session's options.
Also bumps these dev dependencies: `@anthropic-ai/sdk` 1.9.0 → 1.10.0
and `vitest` 5.1.0 → 5.1.1.
`npm update` brings the in-range lockfile bumps: `express-rate-limit`
8.7.4 → 8.7.5, `jose` 6.2.17 → 6.2.18, `object-inspect` 1.13.4 → 1.14.0,
`standardwebhooks` 1.1.1 → 1.3.0, `source-map-js` 1.2.2 → 1.2.3 and
`tinybench` 6.2.3 → 6.2.4.
TypeScript stays at 6.0.3: 7.0.2 is out, but `@typescript-eslint/parser`
8.73.0 still requires `typescript <6.1.0`.
## Options that the SDK refuses
SDK 0.3.327 has a breaking change: `query()` refuses options that it
cannot send to Claude Code, and it does so by throwing at once. Recorded
with the real SDK for `hooks: { PreToolUse: [{ matcher: "Bash" }] }`, a
matcher without `hooks`:
- 0.3.326: `query()` returns, and `initializationResult()` rejects with
"a.hooks is not iterable".
- 0.3.328: `query()` throws "The session was not started, because the
hooks option can't be sent to Claude Code: hooks.PreToolUse[0].hooks
must be an array of callbacks. Fix that value and try again."
Both cores disposed the settings of a session that fails to start (the
`SettingsManager` and its file watchers) only when
`initializationResult()` rejected. A `query()` that throws skipped that,
and v1 also left the session's input open. Both cores now release them
there too. On v1, `discardUnregisteredQuery` does it, and takes no query
for this case.
What changes for a client:
- The error for such options is still `-32603`, now with the SDK's
message in `data.details`. Checked through the built adapter on v1 and
v2. The adapter serves the next request as before.
- **The SDK is stricter.** `hooks` with an event that is no list of
matchers, such as `{ "SessionStart": { … } }`, started a session on
0.3.326. It is refused now ("hooks.SessionStart must be an array of
matchers"), for the events that the adapter adds no hooks of its own to.
## Changelog review
Read the SDK changelog for 0.3.327 and 0.3.328 and the Claude Code
changelog for 2.1.327 and 2.1.328. No other entry needs a code change:
- **Types.** Doc text and new optional members, plus one new
`SDKStartupFailureReason` (`initialize_fields_not_delivered`).
`startupFailureError` treats a reason it does not list as an internal
error with the CLI's message.
- **`task_started` has no `prompt` when Claude Code wakes a background
subagent with text of its own**, such as a task notification. Both cores
start a run without a prompt then (`promptText` in
`src/native-subagents.ts`, `startRun` in `src/v2/tasks.ts`), so the
child's session no longer gets that text as a prompt.
- **The error for usage credits that run out mid-response** no longer
names a rate limit. The adapter takes the failure kind from the SDK's
`error` field, not from the text.
- **More calls ask for permission:** `ExitWorktree` for a worktree that
may hold unsaved work, some paths and symbolic links, and a subagent
that a sibling's message resumed. They reach `canUseTool` as any other
request.
- **`agent` and `agents` fixes** (an inline definition wins over one of
the same name, `--agents` survive a plugin reload). Picked up as they
are: the adapter passes a client's `agents` on.
- **"Background agents still running" after an interrupt, and after a
permission request that waited 30 seconds.** Picked up as they are.
- **`CLAUDE_CODE_DISABLE_DEFERRED_TOOL_RESUME`** and
**`CLAUDE_CODE_DISABLE_SHELL_HEAD_START`.** The adapter sets neither, so
it keeps Claude Code's defaults.
- **`getSessionInfo` and `listSessions`** read a transcript as before: a
differential run of 0.3.326 against 0.3.328 over 4,500 generated
transcripts gave no mismatch. The run is not part of this PR.
- **`@anthropic-ai/sdk` 1.10.0.** The adapter uses its types only. The
release adds API error codes and fixes tool runners that the adapter
does not use.
- **`vitest` 5.1.1.** Bug fixes.
## Not in this PR
- A throw of the adapter's own between the settings read and `query()`
still skips the dispose. Example: a client's `hooks.PostToolUse` that is
an object, which the adapter's own merge of the hooks cannot spread.
- `-32602` for options that the SDK refuses. The code is `-32603`, as it
was for these requests before.
## Testing
- `npm run build`, `npm run check`, `npm run test:run` (4,369 tests
pass)
- Each core has a test with a `query()` that throws the SDK's refusal.
Both fail without the fix.
- Real CLI: the integration tests (`RUN_INTEGRATION_TESTS=true`, with
`CLAUDE_CODE_ENTRYPOINT` unset), 941 tests pass, and one that the test
file itself skips
- Real SDK and CLI, without a prompt: the two `hooks` cases above with
0.3.326 and 0.3.328, and through the built adapter on v1 and v2
## What
A session's config options now reach the client in a new order:
| | Order |
| ------ | ------------------------------------------- |
| Before | mode, model, effort, fast, ultracode, agent |
| After | model, effort, fast, ultracode, mode, agent |
Options that do not apply to a session are still left out, and the rest
keep this relative order. The order is the same on ACP v1 and v2, and
for a subagent's (child) session, which was mode-first too and now sends
model, effort, mode, agent.
Clients that render config options in list order will show the model
picker first and the mode after ultracode.
## How
- The order is defined once, by option id, as `CONFIG_OPTION_ORDER` in
`src/session-config-options.ts`. `buildConfigOptions` (root sessions,
both cores) and the two senders of a child's options
(`NativeSubagentRuntime.publishConfiguration` on v1,
`ChildConfigurations.unsent` on v2) sort through the new
`orderedConfigOptions`.
- An option with an id the order does not name follows the named ones,
in the order it came.
- `orderedSubagentConfiguration` is removed. It ranked by `category`,
which the agent option does not have, and it did not rank `speed` (Fast
mode). It was not exported from `src/lib.ts`.
- `src/v1/acp-agent.ts` is unchanged: every other write to a session's
list replaces an option in place, by id.
## Tests
- New: the root order with all six options present, and the sorter with
ids the order does not name.
- Updated: `session/new` on v1; `session/new`, `session/resume` and
`session/set_config_option` on v2, including the list a model switch
rebuilds; the child session tests on the shared runtime, v1 and v2.
- 43 scenario golden files are regenerated. Five lines of the
`origin-main` baselines (plain and zed) are reordered in place, as #1533
did, instead of adding an allowed difference to `compare.ts`. Every
changed fixture line differs only in the order of `configOptions`.
A client that advertises `session.promptSuggestions` now gets the prompt
that Claude Code predicts the user sends next, as ACP's unstable
`prompt_suggestions_update`, on v1 and v2.
## Why
Claude Code predicts the next prompt after a turn. The adapter sent that
prediction only to JetBrains AIR, as
`session_info_update._meta.promptSuggestions`, because ACP had no update
for it. ACP now has one, behind the client capability
`session.promptSuggestions` in both versions.
## What a client sees
- **With the capability:** `prompt_suggestions_update` with one
suggestion, whose prompt is one text block. An empty list withdraws it.
- **JetBrains AIR:** the `_meta` form, unchanged. An AIR client that
also advertises the capability gets both, the standard update first.
- **Neither:** nothing, and the session asks Claude Code for no
prediction. On v2 that was so before. On v1 it is new: see "v1 cost"
below.
The standard form follows the rules of the draft pages ("Prompt
suggestions (unstable)"):
- The list is withdrawn when a prompt is accepted, and at a
`conversation_reset`.
- A suggestion that is empty or only whitespace is not sent.
- A prediction that arrives while Claude works is dropped, for example
when another prompt was queued before the result. ACP requires a
prediction to match the conversation when it is sent.
- On v2, the list is withdrawn when foreground work starts without a
prompt, such as a cycle that Claude Code starts after a background task.
- Nothing is replayed. Predictions are not in the transcript.
## How
`PromptSuggestions` in `src/prompt-suggestions.ts`, which both cores
share, keeps one state per form and returns the updates to send. The
`_meta` form keeps the rules it had. The v1 core changes only its
existing call sites, and `src/v2/session-update.ts` passes the new
update through.
`promptSuggestionOptions` in the same module gives both cores the SDK
option, by the rule that `PromptSuggestions.forClient` uses: on for a
client that takes a form of the prediction, absent for any other.
## For the reviewer
- **v1 cost:** on `main`, the SDK option `promptSuggestions: true` is on
for every v1 client, not only AIR, so Claude Code spends a request per
turn on a prediction that a client other than AIR never gets. This PR
turns the option on only for AIR and for a client that advertises the
capability, as v2 does. A v1 client that is neither stops paying for the
prediction and sees no other change: it got nothing of it before. A
client's own `_meta.claudeCode.options.promptSuggestions` still wins, in
both directions.
- **v1 autonomous cycles:** the withdrawal when work starts without a
prompt is v2 only. On v1, a prediction that arrives during such a cycle
is dropped, but a list already shown stays until the next prompt.
- **A session that stays live through a load or resume** keeps its
state, while the client's list is empty by rule. The next clear can send
a redundant empty list, and an identical prediction is not sent again.
## Checked against the real CLI
A client that advertises the capability got one
`prompt_suggestions_update` after the second turn of a session, on v1
and on v2. Claude Code predicts nothing after a session's first turn. I
did not check the queued-prompt case live.
## Tests
- `prompt-suggestions.test.ts` (v1) and `v2.test.ts`: each form alone
and both together, the withdrawal at a prompt, the dropped prediction
while Claude works, and on v2 the withdrawal when work starts without a
prompt.
- `create-session-options.test.ts` (v1): the SDK option is on for AIR
and for a client with the capability, absent for any other client, and
off when the caller passes `false`.
`npm run build`, `npm run check` and `npm run test:run` pass (4364
tests, with `main` merged in). The live check above was made before the
v1 option was gated. I did not repeat it.
The Fast mode config option now has the `speed` category, on v1 and v2.
It was `model_config`.
## Why
ACP has an unstable `speed` category for "an option that changes how
fast the model responds, such as a fast mode toggle" (the [speed config
category
RFD](https://github.com/agentclientprotocol/agent-client-protocol/blob/main/docs/rfds/speed-config-category.mdx),
and the draft session config options pages of both versions).
`model_config` tells a client where to put an option, not what it does.
With `speed`, a client can treat this option like any other agent's fast
mode toggle.
A category needs no capability. A client that does not know `speed`
handles it as an unknown category.
## Changes
- `createFastModeConfigOption` in `src/session-fast-mode.ts` builds the
option for both versions, so one change covers both: `category:
"speed"`.
- The two-value select that a v1 client without boolean options gets now
lists Off before On. ACP asks for the values of a `speed` select from
slowest to fastest.
## For the reviewer
- A client that shows `model_config` options next to the model selector
and does not know `speed` will place Fast mode with its other options.
- A client that picks the select's value by position now gets Off first.
- Nothing in the adapter or in `docs/air-extensions.md` reads the
option's category. I did not check how AIR, Zed or Delta place it.
## Tests
- `fast-mode-config.test.ts` (v1): the category, and the order of the
select's values.
- `acp-v2.test.ts`: the category on v2.
`npm run build`, `npm run check` and `npm run test:run` pass (4338
tests).
Stacked on #1657: both change the same lines of `V2Session.start` and
the same README paragraph. Merge #1657 first. GitHub then points this PR
at `main`.
On v2, the adapter now announces a session cursor before each user
message, and `session/fork` forks at one. This is the validation step of
the [session cursors
RFD](https://github.com/agentclientprotocol/agent-client-protocol/blob/main/docs/rfds/session-cursors.mdx)
for this adapter, with the position that its "Adapter validation" table
calls the one both runtimes share: before a user message.
## What a client sees
- **Live:** a prompt that follows another entry of the conversation gets
a `cursor_update` right after its `user_message`:
```json
{
"sessionUpdate": "cursor_update",
"cursorId": "before:<messageId>",
"capabilities": { "fork": {} },
"anchor": { "type": "user_message", "messageId": "<messageId>",
"position": "before" }
}
```
- **Replay:** `session/resume` with `replayFrom` sends the same update
after each replayed user message, with the same `cursorId`.
- **Fork:** `session/fork` with a `cursorId` copies the history before
that message. A client can edit the message, or send it again, in the
new session.
- Any other `cursorId` fails with `-32602` before anything is copied.
#1655 refused every `cursorId`.
No cursor:
- The first entry of a history. Nothing is before it, and Claude Code
forks at an entry.
- A slash command, live. Claude Code stores a command as command
metadata or not at all, so a replay shows no user message for it.
- A subagent's session. A client cannot fork a child.
- A v1 client. See "Not covered".
## How
`src/session-cursors.ts` owns the rules, for both cores:
- `hasForkCursor` decides which stored user messages have a cursor. The
replay uses it to announce, and the fork uses it to accept, so a fork
accepts exactly the cursors that a replay announces.
- The `cursorId` is derived from the uuid of the user message, which
Claude Code stores. It is the same live, in every replay and after a
restart. The adapter keeps no cursors of its own.
- `forkSession` (`src/fork-session.ts`) reads the stored history as a
replay reads it, with the messages before each compaction, and passes
the uuid of the entry before the cursor's message to the SDK's
`forkSession` as `upToMessageId`.
Live, `V2Session.inserted` announces the cursor with the prompt's
`user_message`. A fork finds it once Claude Code has stored the message.
## Not covered
- **v1.** The RFD's v1 form needs message IDs on every anchored message
and anchors a live prompt `after` the entity before it. That is the
RFD's open question, and it needs its own change in the v1 core. A fork
takes a `cursorId` on v1 too, but a v1 client is told of none.
- **Other positions.** The RFD's table also lists after a tool call's
result and after an agent message that ends a turn. The position before
the next user message covers every turn boundary but the last, and
forking the whole session covers that one.
- **A prompt folded into a running turn.** Its cursor's fork ends at a
tool result. I checked a fork at a turn boundary against the real CLI,
not this case.
- A cursor is never withdrawn: it works for as long as the transcript
holds its message.
- AIR's `_meta.jetbrains.air.fork` point is unchanged. A `cursorId` wins
when a request has both.
## Tests
- `fork-session.test.ts` (real SDK, temporary transcripts): a fork at a
cursor copies the history before its message. An unknown id, the first
entry's and a non-user entry's are rejected, and nothing is copied.
- `v2.test.ts`: the live cursor follows the second prompt's
`user_message`, with none for the first prompt or a slash command. A
replay sends the cursor after its message's chunks. `session/fork`
passes `upToMessageId`, and rejects a cursor that the history does not
have.
- `acp-v2.test.ts`: a replayed subagent session gets no cursor.
- The `task-create-update` golden file gains the cursor of its second
prompt.
- `v2-integration.test.ts` (real CLI, run locally): two prompts, a fork
at the second one's cursor, and the fork's replay shows only the first.
`npm run build`, `npm run check` and `npm run test:run` pass (4351
tests).
On v2, a `session/prompt` with an `idempotencyKey` now inserts at most
one user message for that key. This is the follow-up that #1655 left
open.
## Why
ACP v2 (schema v2.0.0-alpha.17) added an optional `idempotencyKey` to
`session/prompt`. Every Agent that advertises `capabilities.session`
must support it: a Client that lost a prompt's response sends the prompt
again with the same key, and the Agent answers with the first
`messageId` without inserting a second message.
The adapter accepted the field and ignored it, so a retry was inserted
again and started its work again.
## What a client sees
| The key in this session | Response |
| --- | --- |
| Not seen | The prompt is handled as before. Its `messageId` is
recorded with the key. |
| A prompt with the key is not answered yet | The same outcome as that
prompt, when it is answered. Nothing more goes to Claude Code. |
| A message was inserted with the key | That message's `messageId`. No
update, no new work. |
| A prompt with the key failed, for example with `-32800` after
`session/cancel` | The key is unused. The prompt is handled as a new
one. |
- A key is known for as long as Claude Code stores its message, also
after `session/close`, on a new connection, and after the adapter
restarts.
- A message that Claude Code does not store, such as a local command's,
keeps its key while the session is active on the connection: from its
start to `session/close`, across restarts of the session's query.
- The same key in another session, a fork too, names another prompt.
- Prompts of one key are not compared. A different prompt with a
recorded key is answered as a retry, which the protocol allows.
- The ACP SDK rejects a key that is not a string of 1 to 255 characters
with `-32602` before the adapter sees it.
## How
The protocol suggests storing the key as part of the message's id, and
Claude Code makes that possible: a prompt that the adapter pushes with a
uuid is stored under that uuid.
`src/v2/prompt-keys.ts` owns the keys of one session:
- A keyed prompt gets a version 8 (custom) UUID. Its first 32 characters
are a SHA-256 hash of the session id and the key. Its last 4 hex digits
count the attempts.
- The `messageId` is that uuid, so no update, `session/list` result or
replay shows the key.
- After a resume, the first keyed prompt reads the stored history once
(`getSessionMessages`, with the messages before each compaction, as a
replay reads it) and looks for a user message with the key's prefix. A
session that this connection created needs no read.
- When that read fails, the key counts as unused and the next lookup
reads again. The session stays usable.
`V2Session.prompt` calls `PromptKeys.once`, which returns the pending
attempt's promise, the stored `messageId`, or runs the prompt. The
promise is returned as it is, so the response keeps its order relative
to the turn's `running`.
`V2Agent` keeps one record per session, so a restart of the session's
query (a provider change, new additional directories) keeps the keys.
### Why each attempt has its own uuid
Claude Code ignores a prompt whose uuid it has seen: it echoes it and
starts no turn. A prompt that `session/cancel` answered with `-32800`
may already have reached Claude Code. If the next attempt reused the
uuid, Claude Code could drop it, and the adapter's own record of prompts
that a cancel stopped would take the new attempt for the old one. So an
attempt after a failure gets the next number, and the lookup matches on
the prefix.
## Checked against the real CLI
Bundled Claude Code of `@anthropic-ai/claude-agent-sdk` 0.3.326:
- A pushed version 8 uuid is accepted, echoed, and returned by
`getSessionMessages` as the user message's uuid.
- The same holds for a prompt that waited in Claude Code's queue, and
for one that it folded into a running turn. The raw transcript stores a
folded prompt as a `queued_command` attachment, and `getSessionMessages`
still returns it under the pushed uuid.
- A second push of a uuid gets an echo and an `idle`, with no
`command_lifecycle` frame and no result.
## Not covered
- `$/cancel_request` for a held prompt is still not honored, with or
without a key. The protocol makes it optional.
- A `session/cancel` that arrives while a retry's history lookup runs
answers the retry with `-32800`, also when the message is stored. The
client's next retry gets the `messageId`.
- If Claude Code took in a prompt that a cancel had already answered
with `-32800`, a retry is inserted as a new message. That is today's
behavior for any cancelled prompt.
- v1 has no `idempotencyKey`.
## Tests
- `v2.test.ts`: a retry of an inserted prompt, of a pending one, and
after a failure (with a new uuid). The same key in another session. The
record across a restart of the query. After a close and a resume, a key
that the stored history holds and one that it does not.
- `v2-integration.test.ts` (real CLI, run locally): one message for a
key, and the key is known after `session/close` and `session/resume`.
`npm run build`, `npm run check` and `npm run test:run` pass (4344
tests).
On v1, a client's request that names a subagent's child session now
fails with `-32602` (Invalid params), as it already does on v2.
## Why
The subagents RFD changed on 2026-11-17: an Agent SHOULD reject a
client's request that is not permitted for a child session with
`-32602`, in both protocol versions. `session/close` and
`session/delete` are included, and do not report success for a child. A
child that the Agent announced is not an unknown session.
`session/cancel` is the one message that can name a child.
The v1 core treated a child's id as an unknown session:
| Request | Before | Now |
| --- | --- | --- |
| `session/prompt`, `session/load`, `session/resume`, `session/fork`,
`session/set_mode`, `session/set_config_option` | `-32002` | `-32602` |
| `session/close`, `session/delete` | success | `-32602` |
| `session/set_title`, `session/status`, `session/options` | handled as
a session without a transcript | `-32602` |
`session/cancel` of a child still stops the child.
## How
- `NativeSubagentRuntime.hasChild` tells whether a session id is a child
that the runtime announced in the RFD form. `cancelChild` now uses the
same lookup. AIR's earlier draft of the RFD keeps its own rules, so the
check is false there.
- `ClaudeAcpAgent.assertNoChildSession` asks the runtime of each session
of the connection.
- `v1AgentApp` wraps each request that names a session in
`ofRootSession`, so all of them get the same check before their handler
runs. The wrapper is not `async`. It returns the handler's promise as it
is, so a setup response keeps its place before the timer of
`afterSetupResponse`.
- `restrictedChild`, the error that the v2 core already threw, moves
from `src/v2/tasks.ts` to `src/acp-subagents.ts`, which both cores
share.
## Not covered
- A child that only a `session/load` replay announced, and whose agent
did not run again on this connection, is still an unknown session
(`-32002`). The check covers the children of a running session. The v2
core has the same limit.
- The adapter's own extension requests (steer, async task stop, goal)
are unchanged.
## Tests
- `acp-agent.test.ts`: each of the eleven requests, sent through the
protocol router with a child's id, fails with `-32602` and names the
child in `data.sessionId`.
- `native-subagents.test.ts`: `hasChild` is true for an announced child,
and false for the root, for an unknown id and in AIR's draft.
`npm run build`, `npm run check` and `npm run test:run` pass (4335
tests). This branch and #1655 merge without conflicts.
Updates `@agentclientprotocol/sdk` from 2.7.0 to 2.8.0 (schema v1.33.0
and v2.0.0-alpha.17), and follows the protocol rules that changed for
what the adapter already serves.
The adapter compiles and passes against 2.8.0 unchanged. The behavior
rules are in the protocol docs, so I read the protocol repo from
`schema-v2.0.0-alpha.16` to its current `main`, which is four docs
commits past the alpha.17 tag.
## Changes
### `session/fork` refuses a `cursorId` (v1 and v2)
`ForkSessionRequest` gained `cursorId` with the session cursors RFD. An
Agent must reject a cursor it did not issue with `-32602`, and must not
fork the whole session in its place.
The adapter sends no `cursor_update`, so it issued no cursor. Before
this change it ignored the field and copied the whole session.
`forkSession` in `src/fork-session.ts` now fails with `-32602` before it
copies anything. Both cores call it.
### No `pattern` in a v2 elicitation form
v2 removed `pattern` from string properties. v1 still has it. The
adapter builds its own forms without it, but it relays an MCP server's
schema as the server sent it.
`v2ElicitationRequest` in `src/v2/elicitation.ts` drops `pattern` from
the string properties of a form before it goes to a v2 client. Nothing
else in the schema changes. The MCP server still gets the answer as the
client sent it and checks it against its own schema.
### A replayed child's current state comes before the response (v2)
On a `session/resume` with replay, the adapter replays each subagent's
end on its parent, then sends the child's current state once more as
current.
- Until alpha.16, the response separated a replayed child state from a
current one. The adapter sent the current states from a timer after the
response, because the ACP SDK has no after-response hook.
- In alpha.17, a `subagent_update` is an update of the child's parent,
so the parent's `replay_complete` is the boundary. A `state_update` on
the child's own stream is never replayed.
The current states now go out after the root's `replay_complete` and
before the state snapshot and the response:
- `SubagentReplay.finish` sends each child's replayed end on its parent,
then the child's `replay_complete`. It no longer sends a `state_update`
on the child's stream.
- `SubagentReplay.currentStates` (was `afterResponse`) then sends each
child's current state on its parent and on its own stream, with `cwd:
null` for a directory that is gone, and the child's configuration when
it differs from what the replay sent.
- The timer is gone from the v2 core. The v1 core keeps
`afterSetupResponse`: on v1 the response is still the boundary.
One case changes besides the order. A child that the live session still
tracks and whose work has ended used to get no current state on its
parent after a replay. It now gets its replayed end there, as a child
whose process is gone does. A child that works now still gets its state
from the resume snapshot.
A v2 client that still reads a child state before the response as
history shows such a child without a confirmed state until it follows
alpha.17.
### Docs
- The README says that `session/prompt` does not use `idempotencyKey`
yet, and that `session/fork` refuses a `cursorId`.
- `docs/subagent-sessions.md` describes the v2 order.
## Already compliant, checked
- `$/cancel_request` for every permission request and elicitation that a
cancel withdraws, now a MUST, and for a closed session's descendants.
- Tool call status: no update moves a live tool call back to `pending`,
and a final status does not change. The `status: null` of
`v2RestartedToolCall` only resets a tool call that a replay or a
repeated `tool_call` starts again.
- A v2 diff always carries one change.
- A `systemPrompt` the adapter cannot apply fails with `-32602` and
creates no session.
- Replay sends terminal output, session messages and compaction
summaries whole, so the wider "clear before replaying chunks" rule adds
nothing. Message chunks were already cleared.
- `tool_call/cancel` and `terminal/cancel`: `-32002` for an unknown
session, `-32602` for an item that cannot be cancelled, and a child
session's id is accepted.
- A request that names a child session fails with `-32602` on v2.
- Only the root session reports a cost, and Claude Code's total includes
its subagents.
- A child's `model` option offers only its current value.
- SDK 2.8.0 dispatches a notification that arrived before the peer
closed its stream. A late `session/cancel` finds the session closed and
does nothing.
## Not covered
- `idempotencyKey` on v2 `session/prompt`. It is part of the v2 baseline
since alpha.17. The adapter accepts the field and does not use it, so a
retry with the same key inserts the message again. The SDK rejects a
malformed key with `-32602`. A follow-up PR adds the lookup.
- Session cursors (`cursor_update`, forking at a cursor) are a new draft
RFD.
- The plan operations RFD now says an Agent can send an empty `items`
plan before `plan_removed`, for a v2 client without plan operations. I
left it out: a client that shows plan updates in its transcript would
show an empty plan.
- I did not run the integration tests against the real CLI.
## Tests
- `fork-session.test.ts`: a `cursorId` fails with `-32602` and no
transcript is copied.
- `v2.test.ts`: `v2ElicitationRequest` drops `pattern` from string
properties only, and passes a URL request as it is.
- `acp-v2.test.ts`: the three replay tests now expect the child's
current state, its parent's copy and a live child's configuration before
the response, and the parent's copy after the root's `replay_complete`.
`npm run build`, `npm run check` and `npm run test:run` pass (4327
tests).
Fixes#1527.
A v1 client that declares `clientCapabilities.subagents` and is not AIR
gets the RFD form of subagent sessions, but still got the prompt hold of
#864/#866: `session/prompt` stayed open until the turn's background
subagents ended. The RFD has the client keep receiving child events
after the parent's prompt response, so the reason for the hold doesn't
apply to it.
`endsTurnsWithLiveSubagents` now also returns true for
`subagentForm(...) === "rfd"`. The rest is the existing no-hold path
that AIR's `backgroundSubagents` uses: the turn ends at its result, and
the subagent's updates and requests go out after the response, with the
same routing. A client that declares neither keeps the hold.
What else changes for an RFD client: the parent's summary when a child
ends used to arrive inside the held turn. It now comes from a followup
cycle out of a turn. Its result ends no turn, and a plan approval that
cycle asks for has no clear-context option, as for AIR.
Tests: the no-hold blocks of "deferred settlement for live background
subagents" run for both clients, except the streamed-tool-input test,
whose fixture has no Agent call that the RFD form could expose the child
from. The RFD test of a background child's tool call closing after a
cancel expects `end_turn` at the result and the cancel while no prompt
runs. `docs/subagent-sessions.md` and `docs/air-extensions.md` say which
clients get the hold.
---------
Co-authored-by: Andrey Bragin <andrey.bragin@jetbrains.com>
## Summary
An MCP server that the client declares with `"type": "acp"` can no
longer fail session setup. The session starts without the server and the
user gets the usual "failed to start" warning.
This comes out of #1651. It does not make the server of that issue
connect (see "Not fixed here").
## What was failing
The adapter serves an `acp` server to Claude Code through a listener on
`127.0.0.1` (`McpOverAcp`, #1645). When that listener could not open,
for example `listen EPERM` where the process may not open a socket,
`session/new` failed with `-32603`:
> Could not open the local endpoint that serves MCP server tools to
Claude Code: listen EPERM: operation not permitted 127.0.0.1. Start the
session without the server, or try again.
A session starts without any other MCP server that does not connect (a
stdio command that is missing, an HTTP server that is down). The `acp`
case was the only one that ended setup.
## What changes
- **`sdkMcpServers`** (`src/mcp-servers.ts`) returns `{ configs,
unserved }`. An `acp` server that gets no endpoint is in `unserved` with
the error, and the other servers keep their configs.
- **Both cores report it** through the existing notice of a client
server that did not start (`mcpServerStartupNotice`), once per server,
on the first turn. On v1 that is `reportMcpServerStartupFailures`, on v2
`SessionReports.mcpStartupFailures`. A resume of the active session on
v2 (`setMcpServers`) reports it the same way.
- **The notice has the error.** Claude Code was never given the server,
so `/mcp` does not list it and "Run /mcp for the error" would lead
nowhere:
> **MCP server "tools" failed to start:** Its tools are unavailable in
this session. The adapter could not open the local endpoint that serves
it to Claude Code (listen EPERM: operation not permitted 127.0.0.1). A
new session tries again.
- The adapter also logs the server and the error at setup.
A later session, or a restart of the session's query, tries to open the
listener again.
## Not fixed here
In #1651 the server is listed as failed because Claude Code sends
`initialize` first and the endpoint accepts MCP 2026-07-28 requests
only. That is unchanged.
Setup did not fail in that case before this PR either. Checked through
the built adapter with Claude Code 2.1.326, without a model turn:
| Case | `session/new` | The server |
| --- | --- | --- |
| Claude Code as it starts by default | succeeds | connects
(`server/discover`, then `tools/list`) |
| `MCP_PROTOCOL_NEGOTIATION=legacy` (Claude Code sends `initialize`) |
succeeds | failed, with the warning |
| The client rejects `server/discover` | succeeds | failed, with the
warning |
| The client never answers `mcp/message` | succeeds | not connected |
| The listener cannot open, before this PR | fails with `-32603` | |
| The listener cannot open, with this PR | succeeds | left out, with the
warning above |
For the last two rows the adapter ran with a preload that makes
`http.Server.prototype.listen` fail.
## Testing
- `npm run check`, `npm run build`, `npm run test:run` (4,314 tests
pass)
- New tests: `sdkMcpServers` with an endpoint that rejects,
`session/new` on v1, the notice on v1, and on v2 both `session/new` and
a resume of the active session
- The live cases in the table above
Refs #1651
## Problem
Claude Code gives up on a reply that stays silent past its stream idle
timeout (5 minutes off Anthropic's API, for example on Bedrock or behind
a gateway), then asks again. If that reply had made a server tool call,
such as the advisor's, the call never gets a result:
- **v1:** the tool call stayed open until the turn ended. Because the
complete assistant message had dispatched it, the turn then failed with
`incomplete_tool_call`, even though Claude Code went on and finished the
work.
- **v2:** the tool call stayed open after the next reply started, and
ended `cancelled` only at the idle.
## Change
- `UnansweredServerToolCalls` (`src/tool-calls/server-tool-calls.ts`)
finds the server tool calls that will never get a result. It tracks each
conversation on its own: the main one, and each subagent's.
- The API puts a server tool's result in Claude's reply: right after the
call or, if the reply ended first (after a client `tool_use`, or at
`pause_turn`), at the start of the next reply. So once a later reply
starts with any other block, the calls still waiting will get no result,
and they close as `retracted`, as the calls of a message Claude Code
took back do: Claude Code replaced the response that made them, and they
may have run. They end `failed` on v1 and `cancelled` on v2.
- Both cores call it from the same two places:
- **Streamed block:** the calls close after that block's own updates, so
a client sees the next step start first.
- **Consolidated message:** matched by its message id, which covers a
retry that did not stream (Claude Code's non-streaming fallback). The
calls close before the message renders.
- On v1 the close carries `_meta.claudeCode.parentToolUseId` for a
subagent's call, as the call's other updates do.
- A server tool call that the turn's last reply leaves without a result
still fails a v1 turn, as before.
## Tests
- `server-tool-calls.test.ts`: unit tests for
`UnansweredServerToolCalls`.
- `v1/incomplete-tools.test.ts`:
- A cut-off advisor call closes once the next reply starts, and the turn
ends with `end_turn`. The close comes after the next reply's tool call
reaches the client and before its text.
- A cut-off advisor call closes when the retry does not stream, by the
consolidated message's id.
- A subagent's cut-off advisor call closes with its `parentToolUseId`.
- A call left pending is answered at the start of the next reply and is
not closed.
- `v2/acp-v2.test.ts`: a cut-off advisor call ends `cancelled` before
the next reply's text, for a retry that streams and one that does not.
- I disabled each change in turn (the consolidated path, the parent
stamp, the close after the block's updates, and each v2 call site), and
its test failed every time.
- `npm run test:run`: 4206 passed. `npm run build` and `npm run check`
are clean.
When a `providers/set` gateway lists none of the allowed models Claude
Code reports, session setup fails with an actionable standard ACP error
before any prompt reaches the provider. The shared
`narrowToGatewayModels` function now owns this check for both ACP
versions. Empty catalogs, model rows without a resolved identity, and
providers without model discovery retain their existing behavior.
Open sessions also fail if they cannot restart under the new provider:
v1 drops the session and reports a session failure to clients with the
AIR capability; v2 preserves the error code and data and tells the
client to fix the cause and then resume the session. Setting a
compatible provider alone does not revive a stopped v2 session. Other
standard restart errors, including authentication failures, also keep
their details and the resume instruction; unknown restart failures
retain the generic recovery message.
Validation: 671 focused tests passed (3 skipped), TypeScript build and
lint/format checks passed. Independent review accepted the exact commit
and separately passed all 206 directly affected tests. The restart
regression fails on the unchanged production code and passes with the
fix. Tests cover a prompt after restoring a compatible provider but
before resuming, preservation of authentication-error code/data,
incompatible listings and cleanup in both protocols, and empty,
alias-only, and mixed model catalogs. These checks use a fake SDK and
gateway with an isolated Claude config directory; the full suite,
installed Air, and a live provider were not exercised in this revision.
---------
Co-authored-by: Codex <codex@openai.com>
## Summary
The adapter now sends a session's MCP servers to Claude Code over stdin,
not on its command line. A server's `env` and `headers` were readable
there by other users of the machine (`ps`). That includes the bearer
token of the local endpoint that serves an MCP-over-ACP server (#1645).
This uses the `mcpServersDelivery` option of SDK 0.3.326. It is stacked
on #1646, which updates the SDK and sets the option to `'argv'`. Merge
#1646 first.
## What changes
`mcpServersDelivery()` in `src/claude-cli.ts` picks the delivery, next
to `claudeCliPath()`, because it depends on which CLI is started:
- **The CLI that the adapter ships** (next to the executable, or the
SDK's platform package) gets the servers in the SDK's initialize
request: `'initialize'`. The SDK starts it with `--await-initialize` and
without `--mcp-config`.
- **A CLI that `CLAUDE_CODE_EXECUTABLE` names** gets them in the
`--mcp-config` flag as before: `'argv'`. Its version is not known, and
the SDK ends the session at startup when the CLI cannot read the servers
from the initialize request. For such a CLI nothing changes, and the
README says so.
Both cores set the value before the client's options, so a client's
`_meta.claudeCode.options.mcpServersDelivery` still wins. A session
without MCP servers starts as before: the SDK adds `--await-initialize`
only when it has servers to send.
## Why `CLAUDE_CODE_EXECUTABLE` keeps `'argv'` for now
Reading the servers from the initialize request needs Claude Code
2.1.326, which came out on 2026-11-16. The `stable` channel of Claude
Code is at 2.1.311. With `'initialize'` for every CLI, a session with an
MCP server would fail for each user whose `CLAUDE_CODE_EXECUTABLE` CLI
is older. Checked with 2.1.323 through the adapter: `session/new` fails
with `-32603` and "This Claude Code (version 2.1.323) is too old to read
MCP servers from the initialize request".
The plan is to drop the `'argv'` case once the `stable` channel is at
2.1.326 or newer, with an error that names `CLAUDE_CODE_EXECUTABLE`.
## Checked against the real CLI
Through the built adapter, with a stdio server that has a secret in its
`env` and an HTTP server with a secret `Authorization` header, and
without a prompt:
| | The adapter's CLI | `CLAUDE_CODE_EXECUTABLE` |
| --- | --- | --- |
| Launch flag | `--await-initialize` | `--mcp-config` |
| Secret on a command line (`ps`) | no | yes, as before |
| stdio server connects and gets its `env` | yes | yes |
This holds on v1 (a probe that is not part of this PR) and on v2. On v2
the MCP-over-ACP integration test now also checks that no command line
of the adapter's processes holds the endpoint's bearer token. With
`CLAUDE_CODE_EXECUTABLE` set, that check finds the token, so the test
skips it there.
With the SDK alone, under `'initialize'`:
- A resumed session (`--resume`) gets its servers: `mcp_servers_applied`
is true and the server connects.
- A startup failure still rejects with its reason: an invalid
`HTTPS_PROXY` gives `startupFailureReason: "proxy_invalid"` and the same
message as under `'argv'`.
## Notes for review
- **One difference that the SDK documents:** a Claude Code process that
the session's own process starts is not handed servers that came in the
initialize request. Subagents run in the session's process and are not
affected.
- **Unit runs take the `'argv'` case.** `vitest.config.ts` sets
`CLAUDE_CODE_EXECUTABLE` for them. So the session tests of v1 and v2
show that the value is passed and that the client's option wins.
`src/tests/claude-cli.test.ts` covers the rule, and the integration test
covers `'initialize'` end to end.
## Testing
- `npm run build`, `npm run check`, `npm run test:run` (4,285 tests
pass)
- Real CLI: the integration tests (`RUN_INTEGRATION_TESTS=true`, with
`CLAUDE_CODE_ENTRYPOINT` unset), 916 tests pass
- Real CLI: the probes above. One of them sends a prompt (one short
Haiku turn, to make a session to resume).
Of 6 full unit runs, 4 passed and 2 had one failure each. The one I
captured is "reads only the changed transcript for a subscription" in
`src/tests/v1/session-index.test.ts`, which passed in 12 runs alone. It
counts the transcripts that the session index reads after a file watcher
event (3 where it expects at most 1). This PR does not touch that code.
Not changed here. The other failure was not captured.
## Summary
Updates `@anthropic-ai/claude-agent-sdk` from 0.3.325 to 0.3.326, which
bundles Claude Code 2.1.326. The new version needs one adapter change,
included here: the adapter now sets the SDK's new `mcpServersDelivery`
option. Its value keeps today's behavior. A follow-up PR changes the
value, so that MCP servers no longer reach Claude Code on its command
line.
Also bumps these dev dependencies: `@anthropic-ai/sdk` 1.8.0 → 1.9.0,
and `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser`
8.72.2 → 8.73.0.
`npm update` brings the in-range lockfile bumps: `hono` 4.13.18 →
4.13.19, `@hono/node-server` 2.1.8 → 2.1.9, `router` 2.2.0 → 2.3.0,
`ignore` 7.0.14 → 7.0.16 and `@tybys/wasm-util` 0.10.4 → 0.10.5.
typescript-eslint 8.73.0 depends on `minimatch` 11, so the lockfile now
holds one `minimatch`, 11.0.9, in place of 10.2.6 and two nested copies
of 11.0.8. That clears the advisory GHSA-g3hv-75wg-m249: `npm audit`
finds nothing.
TypeScript stays at 6.0.3: 7.0.2 is out, but `@typescript-eslint/parser`
8.73.0 still requires `typescript <6.1.0`.
## `mcpServersDelivery`
SDK 0.3.326 adds the option `mcpServersDelivery`, which says how a
session's MCP servers reach Claude Code:
- `'argv'`, the default: in one `--mcp-config` flag. A server's `env`
and `headers` are then on Claude Code's command line.
- `'initialize'`: over stdin, in the initialize request.
Without a change, the new SDK breaks the adapter in two ways:
- The build fails. `OPTION_REBUILDS_SESSION` in
`src/v1/session-fingerprint.ts` must classify every SDK option. The new
one is read when the process starts, so a changed value rebuilds the
query.
- The SDK prints a `DeprecationWarning`
(`CLAUDE_SDK_MCP_SERVERS_ARGV_DEPRECATED`) on stderr, once per process,
when an app names the Claude Code to start, a session has MCP servers
and the option is unset. The adapter always passes
`pathToClaudeCodeExecutable`, so every adapter process with an MCP
server would print it.
The adapter now sets `'argv'`, so MCP servers reach Claude Code as they
did before. The value is one constant, `MCP_SERVERS_DELIVERY` in
`src/claude-cli.ts`, which both cores set before the client's options: a
client's `_meta.claudeCode.options.mcpServersDelivery` wins.
## Changelog review
Read the SDK changelog for 0.3.326 and the Claude Code changelog for
2.1.326. No other entry needs a code change:
- **Types.** Besides `mcpServersDelivery`: doc text, new optional
members, and `BUILTIN_TOOL_NAMES` lists `SetGoal` in place of
`ProposeGoal`. The adapter names neither tool.
- **A warning for a tool list entry that does not look like a complete
rule**, on stderr and as a `system/informational` message. The adapter
adds only `AskUserQuestion` to `disallowedTools` and passes the
`claude_code` preset or `[]` as `tools`, so only a client's own list can
cause it. Both cores send an `informational` warning to the client as a
notice.
- **The `managed_mcp_arrived` warning** is an `informational` warning
too, and is sent the same way.
- **Some tool calls now ask in bypass permissions mode.** Such a call
reaches `canUseTool`. Neither core allows a call there because of the
session's mode, so the user is asked.
- **Bash permission checks ask before more commands.** These reach
`canUseTool` as any other request.
- **`modelUsage` and `total_cost_usd` count billed permission classifier
calls and calls that were stopped or cut.** Both cores take the row of
the turn's model and the increment over the last reading, so a new row
or a larger total needs no change.
- **`message_uuid` on `cancel_async_message` responses.**
`Query.cancelAsyncMessage()` still returns only `cancelled`, and the
adapter does not read the response.
- **`rewindFiles()` skips some files when the sandbox is on.** The
adapter only calls it with `dryRun: true`, for the file-change report.
- **`setMcpServers()`, `resumeSessionAt` and startup hook fixes.**
Picked up as they are: the adapter has no workaround for the old
behavior.
- **`getSessionInfo` and `listSessions`** read a transcript as before: a
differential run of 0.3.325 against 0.3.326 over 4,500 generated
transcripts gave no mismatch. The run is not part of this PR.
- **`@anthropic-ai/sdk` 1.9.0.** The adapter uses its types only. The
release changes API resources and tool helpers that the adapter does not
use.
- **typescript-eslint 8.73.0.** One new rule, which the config does not
turn on, and a narrower report location for `consistent-type-imports`.
`npm run lint` reports nothing.
## Not in this PR
- `mcpServersDelivery: 'initialize'`, which keeps a server's `env` and
`headers` off Claude Code's command line. It changes how a session with
MCP servers starts, and a Claude Code older than 2.1.326 cannot take it,
so it is its own PR, on top of this one.
## Testing
- `npm run build`, `npm run check`, `npm run test:run` (4,283 tests
pass)
- Real CLI: the integration tests (`RUN_INTEGRATION_TESTS=true`, with
`CLAUDE_CODE_ENTRYPOINT` unset), 914 tests pass. They include an MCP
server served over ACP, the output of a foreground Bash command and the
model list.
- Real CLI, without a prompt: with `'argv'`, Claude Code 2.1.326 and
2.1.323 both start a session with a stdio and an HTTP MCP server, and
the SDK prints no deprecation warning.
## Problem
With workflows on (`CLAUDE_CODE_WORKFLOWS=1`), the prompt fails when a
workflow agent asks for permission while the main agent's turn is open:
```text
RequestError: Internal error: Claude ended the turn without returning results for tool calls: toolu_…
data: { errorKind: "incomplete_tool_call" }
```
Seen in a client running workflows in default mode: the main agent
starts a background workflow and keeps working, a workflow agent runs a
quick Bash command after the user allows it, and the main agent's turn
then ends with this error. The workflow itself finishes fine.
## Cause
Claude Code calls `canUseTool` for a workflow agent with an `agentID`
that no `task_started` announces. The workflow's own `task_started`
names the Workflow call, and the agent's tool_use and tool_result never
stream on the root query. `toolUseOwner` finds no parent (the adapter
logs "No parent tool_use recorded for subagent a…; sending the Bash
permission request unattributed"), so `ensureToolCallEmitted` sees no
`parentToolUseId` and the root session id, and records the call as the
turn's foreground work:
```ts
if (!parentToolUseId && notificationSessionId === sessionId && toolName !== "SandboxNetworkAccess") {
recordForegroundToolCall(session, toolCallId);
}
```
The call is still open when the turn's result arrives. The permission
path also recorded it as dispatched, so `settleActive` counts it as
stuck and fails the prompt. A command that runs a few seconds gets a
`task_started`, and `registerLiveTask` forgets the call, so only quick
commands hit this.
## Fix
`ensureToolCallEmitted` takes `canUseTool`'s `agentID`, and a call with
an `agentID` is not recorded as foreground work:
```ts
if (!agentID && toolName !== "SandboxNetworkAccess") {
recordForegroundToolCall(session, toolCallId);
}
```
`toolUseOwner` finds a parent or a child session only for a set
`agentID`, so the two dropped conditions are implied by `!agentID`, and
the result changes only for a subagent with neither. That is a workflow
agent, or a Task subagent whose request beats its `task_started`; the
latter's call was already unlisted by its streamed frame.
`foregroundToolCallIds` feeds only the end-of-turn check. Both callers,
the permission request and the AskUserQuestion elicitation, pass
`agentID`.
v2 is not affected: it never fails a turn for an open tool call, and it
emits a permission's tool call early only for SandboxNetworkAccess.
## Tests
- `v1/incomplete-tools.test.ts`: "does not claim a workflow agent's
permission tool as a foreground tool". The stream is what the CLI sends:
a Workflow tool_use, its `local_workflow` `task_started` and launch
result, then the agent's `canUseTool` with an `agentID` no
`task_started` announced, then the result. It fails without the fix with
"Claude ended the turn without returning results for tool calls:
unfinished-bash".
- `npm run check`, `npm run build` and `tsc --noEmit` pass. `npm run
test:run`: 4179 passed, 36 skipped, 1 failed. The failure is
`acp-scenarios.test.ts` "replaces only the version of this adapter and
the path of this Node binary", which fails the same way on `main` on my
machine.
- Real repro: an ACP client spawning the adapter with Claude Code
2.1.325, default mode, permissions allowed after 1.5s. The main agent
starts a workflow whose one agent runs `date > stamp.txt; cat
stamp.txt`, then goes on with its own work:
| Build | Main turn ends | Result |
| --- | --- | --- |
| `main` (7d9e1f6) | ~27s after the workflow's command | failed 2/2 |
| this branch | ~27s after the workflow's command | clean 4/4 |
| `main` (7d9e1f6) | ~1s after the command is allowed | failed 3/3 |
| this branch | ~1s after the command is allowed | clean 3/3 |
0.101.1 fails the same way (2/2), and this change alone makes it clean
(2/2).
## Not covered
- The workflow agent's tool call still never closes in the client:
nothing streams its result on the root query. That was already the case
when the main turn ended before the request. A probe shows the adapter's
PostToolUse hook does fire for it, with the call's `tool_use_id`, its
`agent_id` and `agent_type: "workflow-subagent"`, so a follow-up could
close it from there.
- The "No parent tool_use recorded" log now fires on every workflow
agent's request, not only on a lost race with `task_started`. Its
comment says so; it is still only `logger.log`.
- `npm run test:integration` was not run.
Related: #1501 hits the same check through the same eager permission
call, for a root `confirm_<uuid>` question with no `agentID`. This PR
does not change it.
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-11-17 12:52:59 +00:00
254 changed files with 26864 additions and 2864 deletions
if ! missing="$(scripts/missing-release-archives.sh "$tag")"; then
echo "::error title=No release $tag::'$REF' is version $version, which has no GitHub release. Create it first (docs/RELEASES.md, 'The release PR merged but nothing was tagged')."
exit 1
fi
echo "tag=$tag" >> "$GITHUB_OUTPUT"
if [ -z "$missing" ]; then
echo "build=false" >> "$GITHUB_OUTPUT"
echo "$tag already has every archive; not rebuilding them." >> "$GITHUB_STEP_SUMMARY"
exit 0
fi
# Pass the SHA so every runner builds the commit checked here even if the tag moves.
tagged="$(gh api "repos/$GH_REPO/commits/tags/$tag" --jq .sha)"
requested="$(gh api "repos/$GH_REPO/commits/$REF" --jq .sha)"
if [ "$requested" != "$tagged" ]; then
echo "::error title=$tag lacks archives::'$REF' is not the commit $tag points to ($tagged). Run again with ref=$tag to build them."
# Keep a notice at the top of the release notes while archives are
# missing, so someone looking for one knows why it isn't there.
start="<!-- missing-binaries -->"
end="<!-- /missing-binaries -->"
body="$(gh release view "$TAG" --json body --jq .body)"
# The notes without an earlier notice and the blank line after it.
notes="$(awk -v start="$start" -v end="$end" '
drop_blank { drop_blank = 0; if ($0 == "") next }
$0 == start { skip = 1 }
skip { if ($0 == end) { skip = 0; drop_blank = 1 } next }
{ print }' <<<"$body")"
if [ -n "$missing" ]; then
notice="$start"$'\n'"> [!WARNING]"$'\n'"> Not attached yet: $(paste -sd ' ' - <<<"$missing" | sed 's/ /, /g'). They will be attached once their build is fixed."$'\n'"$end"
notes="$notice"$'\n\n'"$notes"
fi
if [ "$notes" != "$body" ]; then
gh release edit "$TAG" --notes "$notes"
fi
if [ -n "$missing" ]; then
echo "::error title=$TAG lacks archives::The release still lacks $(paste -sd ' ' - <<<"$missing"), so the registry was not updated. retry-binaries.yml re-runs the failed jobs up to twice; after that, run: gh run rerun $GITHUB_RUN_ID --failed --repo $GITHUB_REPOSITORY"
exit 1
fi
# Same shape as publish-npm. Tagging is a separate job, so nothing here needs
# write access to the repository.
@@ -231,11 +347,13 @@ jobs:
echo "Tagged \`v$VERSION\` at \`$SHA\`" >> "$GITHUB_STEP_SUMMARY"
trigger-registry-update:
# upload-binaries too, so a stable release's archives are attached before the
# registry reads the release: it takes each archive's sha256 from the release
# assets when it bumps the version. It only waits; a failed or skipped upload
* read stored Claude sessions from a replay cursor ([#1729](https://github.com/agentclientprotocol/claude-agent-acp/issues/1729)) ([22ca229](https://github.com/agentclientprotocol/claude-agent-acp/commit/22ca2293635e0c383392e4ae7b8fab785f633b6f))
* follow the permission mode that Claude Code reports ([#1740](https://github.com/agentclientprotocol/claude-agent-acp/issues/1740)) ([5ff3411](https://github.com/agentclientprotocol/claude-agent-acp/commit/5ff3411cfa8d8c0fbf939995a4587c254d812735))
* record the permission mode that Claude Code names after a mode change ([#1737](https://github.com/agentclientprotocol/claude-agent-acp/issues/1737)) ([4dd607c](https://github.com/agentclientprotocol/claude-agent-acp/commit/4dd607cec1747c6936d9ffc9ccc68e619e36fca4))
* refuse to start a session when Claude Code skipped an invalid settings file ([#1719](https://github.com/agentclientprotocol/claude-agent-acp/issues/1719)) ([e28b50d](https://github.com/agentclientprotocol/claude-agent-acp/commit/e28b50d4f401dc9c3a4fdc8eda27e29989658ba8))
* Respect remote managed settings for model, effort and permission modes ([#1717](https://github.com/agentclientprotocol/claude-agent-acp/issues/1717)) ([1c2510d](https://github.com/agentclientprotocol/claude-agent-acp/commit/1c2510dd45abd4337e02b15921f57f29573246fd))
* send MCP servers and settings over stdin to a Claude Code that CLAUDE_CODE_EXECUTABLE names ([#1741](https://github.com/agentclientprotocol/claude-agent-acp/issues/1741)) ([9f9acd2](https://github.com/agentclientprotocol/claude-agent-acp/commit/9f9acd2b6e59212575917fc788b69853f3a03ee1))
* sign in to MCP servers of Claude Code's settings on /mcp reconnect ([#1728](https://github.com/agentclientprotocol/claude-agent-acp/issues/1728)) ([bc752f8](https://github.com/agentclientprotocol/claude-agent-acp/commit/bc752f88e1e7d46ff49064b1971eebfc23e5d020))
* stop an autonomous turn while a prompt waits ([#1727](https://github.com/agentclientprotocol/claude-agent-acp/issues/1727)) ([1762ccf](https://github.com/agentclientprotocol/claude-agent-acp/commit/1762ccff2e61197e6b0e642637488552e87c1dc1))
* update to @anthropic-ai/claude-agent-sdk 0.3.333 ([#1739](https://github.com/agentclientprotocol/claude-agent-acp/issues/1739)) ([daeda8c](https://github.com/agentclientprotocol/claude-agent-acp/commit/daeda8cce313d50116401e121626fc9820d6cb92))
* serve /plugin in ACP sessions ([#1716](https://github.com/agentclientprotocol/claude-agent-acp/issues/1716)) ([0f095f6](https://github.com/agentclientprotocol/claude-agent-acp/commit/0f095f678dac9cf4a7ca3623261fa3f6729e73b0))
* start Remote Control with the session when Claude Code asks for it ([#1523](https://github.com/agentclientprotocol/claude-agent-acp/issues/1523)) ([893f768](https://github.com/agentclientprotocol/claude-agent-acp/commit/893f7680c7ed57be7fc7be7f4e9abac268884ff2))
### Bug Fixes
* **background:** keep a tool call whose task joins the live set after its result ([#1639](https://github.com/agentclientprotocol/claude-agent-acp/issues/1639)) ([677a6d9](https://github.com/agentclientprotocol/claude-agent-acp/commit/677a6d9afab3c7bad41fdf2587a24b2414236b29))
* rewind the same provider session on an edited message ([#1704](https://github.com/agentclientprotocol/claude-agent-acp/issues/1704)) ([f2897d6](https://github.com/agentclientprotocol/claude-agent-acp/commit/f2897d6687f594220c07836c3e3528de552e30ef))
### Bug Fixes
* stop holding an MCP request that Claude Code gave up ([#1711](https://github.com/agentclientprotocol/claude-agent-acp/issues/1711)) ([d5be0e5](https://github.com/agentclientprotocol/claude-agent-acp/commit/d5be0e5827fb111e5e95020d76920fe8a59e671b))
* name the session and tool call of MCP requests sent over ACP ([#1705](https://github.com/agentclientprotocol/claude-agent-acp/issues/1705)) ([fa02bc2](https://github.com/agentclientprotocol/claude-agent-acp/commit/fa02bc239ff3f3557b1797d1137a9bc34bd4d339))
### Bug Fixes
* start a session without the MCP servers that Claude Code refuses ([#1708](https://github.com/agentclientprotocol/claude-agent-acp/issues/1708)) ([f6525de](https://github.com/agentclientprotocol/claude-agent-acp/commit/f6525de507f9f628d4e3e8781eb61488f965b7de))
* update to @anthropic-ai/claude-agent-sdk 0.3.331 ([#1707](https://github.com/agentclientprotocol/claude-agent-acp/issues/1707)) ([9062779](https://github.com/agentclientprotocol/claude-agent-acp/commit/9062779cda651aaeaf8a07a8ea2c8edeb76924fa))
* write error messages as plain text ([#1709](https://github.com/agentclientprotocol/claude-agent-acp/issues/1709)) ([2c37f97](https://github.com/agentclientprotocol/claude-agent-acp/commit/2c37f979b60e0db2a069f99fdc85da3c8822dc1e))
* Closing the gaps for the ACP v2 support ([#1542](https://github.com/agentclientprotocol/claude-agent-acp/issues/1542)) ([105e1c3](https://github.com/agentclientprotocol/claude-agent-acp/commit/105e1c38daf76bc832e872e95904be6dabd32372))
* preserve existing line endings in ACP v2 terminal output ([#1697](https://github.com/agentclientprotocol/claude-agent-acp/issues/1697)) ([9ca8984](https://github.com/agentclientprotocol/claude-agent-acp/commit/9ca8984d55132991b2eec0f87c45acbb820b38a3))
* name each model's effort levels in its model option entry for AIR ([#1692](https://github.com/agentclientprotocol/claude-agent-acp/issues/1692)) ([130fbbc](https://github.com/agentclientprotocol/claude-agent-acp/commit/130fbbc02ab4771443b2f365f2af1659ceb0c591))
* announce a live subagent again when its session is loaded or resumed ([#1688](https://github.com/agentclientprotocol/claude-agent-acp/issues/1688)) ([b977017](https://github.com/agentclientprotocol/claude-agent-acp/commit/b977017ed88148fbbc8bdd6e24cd275313c546e6))
* apply a provider's route to the running session ([#1691](https://github.com/agentclientprotocol/claude-agent-acp/issues/1691)) ([988a58b](https://github.com/agentclientprotocol/claude-agent-acp/commit/988a58b908d55a933e9d297c142e9040d478bd69))
* give a forked skill's child session its tool calls and text ([#1677](https://github.com/agentclientprotocol/claude-agent-acp/issues/1677)) ([1c90fb9](https://github.com/agentclientprotocol/claude-agent-acp/commit/1c90fb959a003eba1eed1dac94400c9cdef63195))
* keep built-in web-fetch and claude-code-guide agents out of the Agent picker ([#1672](https://github.com/agentclientprotocol/claude-agent-acp/issues/1672)) ([eb4c16f](https://github.com/agentclientprotocol/claude-agent-acp/commit/eb4c16f10a753925090289c21f2d95bd902a7b63))
* match v1 session/options to resume when workspace roots change ([#1679](https://github.com/agentclientprotocol/claude-agent-acp/issues/1679)) ([184b7df](https://github.com/agentclientprotocol/claude-agent-acp/commit/184b7df993c0c64df593188f15bb0e5206f3e6fb))
* reject requests that name a replayed subagent session with -32602 ([#1686](https://github.com/agentclientprotocol/claude-agent-acp/issues/1686)) ([3304ca7](https://github.com/agentclientprotocol/claude-agent-acp/commit/3304ca724c25c7258c837cc0394adb4111ea8987))
* report unusable Claude subscriptions as unauthenticated ([#1678](https://github.com/agentclientprotocol/claude-agent-acp/issues/1678)) ([a4f0f78](https://github.com/agentclientprotocol/claude-agent-acp/commit/a4f0f78bb31539005d0d54ab69f7e28f91443b14))
* send a replayed subagent's configuration after the replay, not inside it ([#1685](https://github.com/agentclientprotocol/claude-agent-acp/issues/1685)) ([6a760cb](https://github.com/agentclientprotocol/claude-agent-acp/commit/6a760cbca64adc72634274088914e99a51da084a))
* show readable titles for MCP tool calls ([#1674](https://github.com/agentclientprotocol/claude-agent-acp/issues/1674)) ([80440d8](https://github.com/agentclientprotocol/claude-agent-acp/commit/80440d8b8294f9d4cd086d7cba39c716107657f0))
* update to @agentclientprotocol/sdk 2.9.0 ([#1687](https://github.com/agentclientprotocol/claude-agent-acp/issues/1687)) ([022ff53](https://github.com/agentclientprotocol/claude-agent-acp/commit/022ff532449371198a0d715a921578e27c101532))
* update to @agentclientprotocol/sdk 2.9.1 ([#1690](https://github.com/agentclientprotocol/claude-agent-acp/issues/1690)) ([85a0d6c](https://github.com/agentclientprotocol/claude-agent-acp/commit/85a0d6c6f111119855b0e199801a9f71b60f50bf))
* update to @anthropic-ai/claude-agent-sdk 0.3.330 ([#1689](https://github.com/agentclientprotocol/claude-agent-acp/issues/1689)) ([6d9e276](https://github.com/agentclientprotocol/claude-agent-acp/commit/6d9e2766c74dcd9ccd5c5a83b8523b65c234041f))
* announce session cursors on v2 and fork at a cursor ([#1658](https://github.com/agentclientprotocol/claude-agent-acp/issues/1658)) ([5075d2e](https://github.com/agentclientprotocol/claude-agent-acp/commit/5075d2e0dffed68c4c1417d67c1c1e3ed43e6549))
* insert one message per idempotencyKey on v2 session/prompt ([#1657](https://github.com/agentclientprotocol/claude-agent-acp/issues/1657)) ([1c0792e](https://github.com/agentclientprotocol/claude-agent-acp/commit/1c0792ea8cbdfb96ac2afb1f675e4309446d0e5c))
* order config options as model, effort, fast, ultracode, mode, agent ([#1666](https://github.com/agentclientprotocol/claude-agent-acp/issues/1666)) ([f31da7f](https://github.com/agentclientprotocol/claude-agent-acp/commit/f31da7f9f5264eb2b57fbda577ac35141eb530c8))
* report Fast mode in the speed config option category ([#1659](https://github.com/agentclientprotocol/claude-agent-acp/issues/1659)) ([8990c24](https://github.com/agentclientprotocol/claude-agent-acp/commit/8990c2441d3d45cb4781cd81316b3ffbafee85ee))
* send the predicted next prompt as prompt_suggestions_update ([#1660](https://github.com/agentclientprotocol/claude-agent-acp/issues/1660)) ([f20ed1d](https://github.com/agentclientprotocol/claude-agent-acp/commit/f20ed1d96ac786af36b6bee3b4d5925a85b6d7ae))
### Bug Fixes
* send a session's settings to Claude Code over stdin ([#1669](https://github.com/agentclientprotocol/claude-agent-acp/issues/1669)) ([a768a9f](https://github.com/agentclientprotocol/claude-agent-acp/commit/a768a9f50c65b66b9f2d5806909a1db643fe3b6e))
* update to @anthropic-ai/claude-agent-sdk 0.3.328 ([#1668](https://github.com/agentclientprotocol/claude-agent-acp/issues/1668)) ([6e30711](https://github.com/agentclientprotocol/claude-agent-acp/commit/6e307116d461af22fb5d42eb4b8fbdb3643c6d6c))
* answer -32602 on v1 for a request that names a subagent's session ([#1656](https://github.com/agentclientprotocol/claude-agent-acp/issues/1656)) ([253cd84](https://github.com/agentclientprotocol/claude-agent-acp/commit/253cd84ed84efd38fd9d90faaf954690d1610677))
* close a server tool call whose reply Claude Code gave up on, once its next reply starts ([#1604](https://github.com/agentclientprotocol/claude-agent-acp/issues/1604)) ([3205f0b](https://github.com/agentclientprotocol/claude-agent-acp/commit/3205f0bf0211f9346dad8583944f007bd0ef73c2))
* end a v1 turn at its result for a client in the subagents RFD form ([#1603](https://github.com/agentclientprotocol/claude-agent-acp/issues/1603)) ([c4b64f6](https://github.com/agentclientprotocol/claude-agent-acp/commit/c4b64f628d1fad37ed1d56016b91eefc59df5052))
* reject session setup for an incompatible model provider ([#1506](https://github.com/agentclientprotocol/claude-agent-acp/issues/1506)) ([90070d6](https://github.com/agentclientprotocol/claude-agent-acp/commit/90070d6cbf29f5425e4e08828552f91493dd3e59))
* start a session without an MCP-over-ACP server whose local endpoint cannot open ([#1653](https://github.com/agentclientprotocol/claude-agent-acp/issues/1653)) ([96dd2bb](https://github.com/agentclientprotocol/claude-agent-acp/commit/96dd2bb10d838aeb39d75bb0cfde1c7b4eae958a)), closes [#1651](https://github.com/agentclientprotocol/claude-agent-acp/issues/1651)
* update to @agentclientprotocol/sdk 2.8.0 ([#1655](https://github.com/agentclientprotocol/claude-agent-acp/issues/1655)) ([b6167a8](https://github.com/agentclientprotocol/claude-agent-acp/commit/b6167a82dba9864a13dad31a7cad151704badf5e))
* stream the output of foreground Bash commands ([#1587](https://github.com/agentclientprotocol/claude-agent-acp/issues/1587)) ([378e85d](https://github.com/agentclientprotocol/claude-agent-acp/commit/378e85d06027f5fa1802e94535548747a0feccc9))
* support MCP servers that the client serves over the ACP connection (MCP-over-ACP) ([#1645](https://github.com/agentclientprotocol/claude-agent-acp/issues/1645)) ([20aeb46](https://github.com/agentclientprotocol/claude-agent-acp/commit/20aeb46ecedc60fef26ca8b1439b37e3bbd9b27a))
### Bug Fixes
* an autonomous result naming the original prompt must not end a steered turn early ([#1451](https://github.com/agentclientprotocol/claude-agent-acp/issues/1451)) ([edab713](https://github.com/agentclientprotocol/claude-agent-acp/commit/edab7135028d83efaeaa38d0f8efe62ea7ddf203))
* do not count a confirmWithUser question as an unfinished tool call ([#1644](https://github.com/agentclientprotocol/claude-agent-acp/issues/1644)) ([bcd3cda](https://github.com/agentclientprotocol/claude-agent-acp/commit/bcd3cdad35e4356247303870ac3137675e401227))
* handle invalid file paths in tool reports ([#1419](https://github.com/agentclientprotocol/claude-agent-acp/issues/1419)) ([0073280](https://github.com/agentclientprotocol/claude-agent-acp/commit/0073280b977a69934fb56670943d1ef42e7b687e))
* keep a workflow agent's tool call out of the turn's unfinished tools ([#1638](https://github.com/agentclientprotocol/claude-agent-acp/issues/1638)) ([451bc04](https://github.com/agentclientprotocol/claude-agent-acp/commit/451bc04ae022ef02473bdd92740cf19d8ceb5f3c))
* offer clearing the context on plan approval only when Claude Code's setting is on ([#1627](https://github.com/agentclientprotocol/claude-agent-acp/issues/1627)) ([9d71d12](https://github.com/agentclientprotocol/claude-agent-acp/commit/9d71d12336c392c28967c600f8409841deaab7e0))
* send MCP servers to Claude Code over stdin, not on its command line ([#1647](https://github.com/agentclientprotocol/claude-agent-acp/issues/1647)) ([c4dd80d](https://github.com/agentclientprotocol/claude-agent-acp/commit/c4dd80d7392b035f331b50bfdd802cfb3e144d37))
* update to @anthropic-ai/claude-agent-sdk 0.3.326 ([#1646](https://github.com/agentclientprotocol/claude-agent-acp/issues/1646)) ([4a07639](https://github.com/agentclientprotocol/claude-agent-acp/commit/4a076397c6e785a8dd9166e8ea1df14fe17c52ed))
- Client MCP servers, including the ones that the client serves over the ACP connection ([MCP-over-ACP](https://agentclientprotocol.com/rfds/mcp-over-acp), `"type": "acp"`)
- Client MCP servers, including the ones that the client serves over the ACP connection ([MCP-over-ACP](https://agentclientprotocol.com/rfds/mcp-over-acp), `"type": "acp"`). Where an organization's managed settings (`disableSideloadFlags`) keep them out, a session starts without them and says so in a notice
- An Ultracode session config option, which turns on Claude Code's dynamic workflows for every task. It appears when dynamic workflows are enabled and the model supports ultracode (any model with `xhigh` effort)
-`/mcp` in the chat: the MCP server status as a list. The adapter runs `/mcp reconnect`, `/mcp enable`, and `/mcp disable` through the SDK control API, because Claude Code refuses them in SDK mode. A reconnect of an ACP server that needs authentication starts MCP OAuth through URL elicitation
-`/plugin` (aliases `/plugins`, `/marketplace`) in the chat: the adapter runs `claude plugin …` for install, uninstall, enable, disable, update, and list, and `marketplace add|list|remove|update`, because Claude Code refuses `/plugin` in SDK mode, then reloads the session's plugins. It is not available in remote (`sdk-url`) sessions
- Prompt suggestions: the prompt that Claude Code predicts the user sends next, as ACP's unstable `prompt_suggestions_update`, for a client that advertises `session.promptSuggestions`
- Session-scoped long-running goals for AIR through the [goal extension](docs/air-extensions.md#goal) under `_meta.jetbrains.air.goal`
- Structured errors, recovery, and warnings through the opt-in [session failure extension](docs/air-extensions.md#session-failure)
- Concrete model and effort defaults through the opt-in [recommended config value extension](docs/air-extensions.md#recommended-config-values)
@@ -46,6 +48,10 @@ Claude CLI (`claude`) it runs. Keep them in the same directory; a symlink to
instead, set `CLAUDE_CODE_EXECUTABLE`. On Alpine, install `libgcc` and
`libstdc++` first.
A CLI named with `CLAUDE_CODE_EXECUTABLE` must be Claude Code 2.1.328 or newer:
the adapter sends a session's MCP servers and settings to Claude Code over
stdin. With an older one, a session that has either does not start.
To build one for your machine (needs [Bun](https://bun.sh)) and check it:
```sh
@@ -53,11 +59,11 @@ npm run build:binary
npm run smoke:binary # add `-- --full` to drive a real session; needs a Claude login
```
### Experimental ACP v2
### ACP v2 (Preview)
The adapter also serves the [draft ACP v2](https://agentclientprotocol.com/protocol/v2/overview):
a client that asks for protocol version 2 or later in `initialize` gets v2, and every other client
gets v1. The draft can still change, and this surface changes with it.
The adapter also serves [ACP v2](https://agentclientprotocol.com/protocol/v2/overview), which is in
Preview: a client that asks for protocol version 2 or later in `initialize` gets v2, and every other
client gets v1. v2 is not frozen yet, and this surface changes with it.
`CLAUDE_AGENT_ACP_PROTOCOL` limits the adapter to one version. With `v1`, a client that asks
for v2 is negotiated down to v1. With `v2`, the adapter rejects the `initialize` of a v1 client.
@@ -70,6 +76,29 @@ with replay, which `replay_complete` ends, `session/close`, `session/prompt`, `s
compaction, display terminals for commands, permission requests, elicitation, providers, auth, and
[subagents](docs/subagent-sessions.md). Steering is v1 only for now.
On v2, the `command` of a stdio MCP server must be an absolute path, such as `/usr/local/bin/npx`.
`session/new`, `session/resume` and `session/fork` fail with `-32602` for a relative one, such as
`npx`. A v1 client can still send one.
`session/prompt` takes an `idempotencyKey`: a prompt that a client sends again with the same key
is inserted once, and the retry gets the first `messageId`. The key is known for as long as Claude
Code stores the message, also after a restart. A prompt that Claude Code does not store, such as a
local command, keeps its key until `session/close` or the end of the connection.
A client can [read and follow a stored session](docs/session-read.md) through `_session/read` while a terminal continues writing it.
The adapter announces a session cursor (`cursor_update`) before each user message that follows
another entry of the conversation, live and in a replay. `session/fork` with its `cursorId` copies
the history before that message, and fails with `-32602` for any other `cursorId`. A v1 client gets
cursors only when it declares `clientCapabilities.session.cursors`. A v1 replay (`session/load`)
anchors each cursor `before` its replayed user message. A live v1 prompt is not reported to the
client that sent it, so its cursor is anchored `after` the last agent message, thought, tool call or
compaction before it, with the same `cursorId` that a later replay issues. A session that was
resumed without a replay has no such entity, so its live prompts get no cursor until it replays.
When a v1 turn reports no entity (it was cancelled or failed before any output, or it was a slash
command), the next prompt's cursor has the same `after <entity>` anchor as the previous prompt's
cursor, with a different `cursorId`: the client uses the latest.
v2 is served by the v2 agent in `src/v2/`, which runs straight on Claude
Code instead of translating to v1. A v2 client that declares JetBrains AIR
(`_meta.jetbrains.air`) also gets the AIR extensions that ACP v2 does not cover.
@@ -147,6 +149,12 @@ The response to a client that is not AIR has no `_meta.jetbrains` key.
### ACP v2
A busy `session/prompt` steers the current turn on ACP v2.
It waits while a root or child permission request or elicitation is open.
The adapter does not advertise `claudeCode.promptQueueing` on v2.
On ACP v1, an ordinary `session/prompt` queues behind the current turn.
The separate `_session/steering` request steers that turn.
The v2 core (`src/v2/`) serves an AIR client only the extensions that ACP v2 does not cover.
Its `initialize` response lists `agentFileChangeReport` and `recommendedValue`.
It also serves the [permission presentation](#permission-presentation), the [question custom answers](#question-custom-answers), the [predicted follow-up prompt](#predicted-follow-up-prompt), and [load replay end](#load-replay-end).
@@ -172,6 +180,7 @@ It does not serve the [tool call contract](#tool-call-contract) yet.
| `sessionRename` | with `sessionIndex` | Nothing on its own: the agent lists it to tell that it supports `_session/rename`. | [Rename](#rename) |
| `sessionListSubscribe` | with `sessionIndex` | Nothing on its own: the agent lists it to tell that it supports `_session/list/subscribe`. | [List subscription](#list-subscription) |
| `sessionWorktrees` | with `sessionIndex` | Nothing on its own: the agent lists it to tell that rows carry `agentWorktree` for a worktree Claude Code made. | [List response](#list-response) |
| `sessionRewind` | on request | Accepts `_session/rewind`, and announces its session cursors with the `rewind` capability. | [Session rewind](#session-rewind) |
| `loadReplayEnd` | no | Sends one `session_info_update` after the whole history replay of a loaded session. | [Load replay end](#load-replay-end) |
| `rawInputRendering` | no | Sends no display copy of readable input in `content`. The client renders `rawInput`. | [Tool call contract](#tool-call-contract) |
@@ -195,6 +204,7 @@ The adapter sends these keys only to an AIR client. "AIR" in the Gate column mea
| `diffPatch` | tool call and permission request `content[]` of type `diff`, `_meta.jetbrains.air` | `{version: 1, format: "git_patch", text}` | `diffPatch` |
| `contextCompaction` | compaction tool call or `compaction_update`, `_meta.jetbrains.air` | `{version: 1, trigger?, preTokens?, postTokens?, durationMs?, error?}` | AIR |
| `customAnswer` | elicitation schema property `_meta.jetbrains.air` | `{questionId, isCustomAnswer: true}` | AIR, when the client supports form elicitation |
| `customAnswerFields` | elicitation request `_meta.jetbrains.air` | companion field keys | AIR, when the client supports form elicitation |
| `kind` | session mode `_meta.jetbrains.air` and mode config option value `_meta.jetbrains.air` | `standard`, `plan`, `auto_review`, or `full_access` | AIR |
| `kind` | available command `_meta.jetbrains.air` of a skill | `skill` | AIR, when the skill's `SKILL.md` is found; not for a built-in command or an MCP prompt |
| `skillPath` | available command `_meta.jetbrains.air` of a skill | absolute path of the skill's `SKILL.md` | AIR, together with `kind: "skill"` |
@@ -228,7 +239,9 @@ The adapter keeps them where they are.
## Auth source display
The connection-scoped `_auth/status_update` continues to report agent-owned authentication, not client-owned `providers/set` routing. The adapter also reports the same identity through the ACP `auth/status` method and `auth/status_update` notification (advertised as `auth.status`), with `kind`, `detail` and `plan` under the account's `_meta.claudeCode`. The account's `description` carries the `detail` too, e.g. `label: "Anthropic API key"` with `description: "ANTHROPIC_API_KEY"`. Each notification is sent when its own payload changed. `auth/status` answers with the identity last reported and starts a new read, whose change arrives as a notification. When the active key source is `apiKeyHelper`, the adapter reads the effective helper command through SDK `resolveSettings` / the session's `SettingsManager`, including programmatic settings overrides.
The connection-scoped `_auth/status_update` reports agent-owned authentication, not client-owned `providers/set` routing. The adapter also reports that login through the ACP `auth/status` method and `auth/status_update` notification (advertised as `auth.status`). Under `--hide-claude-auth`, a subscription the integration cannot use is `unauthenticated`, with no active account; the legacy notification still describes the stored login. Enterprise subscriptions, API keys, and setup tokens remain usable.
For a reported account, `_meta.claudeCode` carries `kind`, `detail` and `plan`. The account's `description` carries the `detail` too, e.g. `label: "Anthropic API key"` with `description: "ANTHROPIC_API_KEY"`. Each notification is sent when its own payload changed. `auth/status` answers with the identity last reported and starts a new read, whose change arrives as a notification. When the active key source is `apiKeyHelper`, the adapter reads the effective helper command through SDK `resolveSettings` / the session's `SettingsManager`, including programmatic settings overrides.
A command containing the whole word `central` and the word sequence `proxy start` is displayed as:
@@ -344,11 +357,11 @@ For every tool, a client that is not AIR also gets these upstream fields:
| `TodoWrite`, `TaskCreate`, `TaskUpdate`, `TaskList`, `TaskGet` | The stream reports them as a standard `plan` with entries. Only a permission request shows them as a tool call. | A plan that repeats the previous plan is not sent. | Every plan goes out. |
| `ReportFindings` | `kind: think`, `title: "Report <n> findings"`. | With `rawInputRendering`, no copy of the findings in `content`. | none |
| MCP tools (`mcp__*`) and other tools | `kind: other`, `title` is the tool name. The result text goes to `content`. | `_meta.is_mcp_tool_call` for MCP, and `_meta.jetbrains.air.mcp = {server, tool}`. | none |
| MCP tools (`mcp__*`) and other tools | `kind: other`, `title` is `server: tool` for a complete MCP name, otherwise the tool name. Result text goes to `content`. | `_meta.is_mcp_tool_call` for MCP, and `_meta.jetbrains.air.mcp = {server, tool}`. | none |
| Context compaction | `compaction_update` when the client declares `session.compaction`. Otherwise a synthetic tool call. | Both forms carry `_meta.jetbrains.air.contextCompaction`. | See [Context compaction](#context-compaction). |
| Background work that is not a subagent | none | With `asyncTasks`, async task updates. | none |
`_meta.jetbrains.air.mcp` comes from the tool name `mcp__<server>__<tool>`, on `tool_call` and on a `tool_call_update` that changes it.
The standard `name` stays `mcp__<server>__<tool>`. AIR also gets those parts in `_meta.jetbrains.air.mcp` on `tool_call` and on a `tool_call_update` that changes it.
`server` is the part up to the next `__`. `tool` is the whole rest and can contain `__`, as in Claude Code.
A name that does not split (`mcp__x`) gets no `mcp` key, and `_meta.is_mcp_tool_call` still marks it.
@@ -859,8 +872,9 @@ A failed command restores the previous state.
After a turn, the Claude Code CLI can predict the prompt the user is likely to send next.
The adapter asks for it with the SDK option `promptSuggestions: true` and forwards the one prediction of the turn.
It asks only in a session of AIR or of a client that advertises `session.promptSuggestions`, on v1 and v2: a prediction costs a request per turn, and no other client would get it.
ACP has no field for a composer prefill, so the prediction travels outside the AIR namespace:
AIR reads the prediction from a `_meta` key outside the AIR namespace, which the adapter used before ACP had an update for it:
```json
{
@@ -869,9 +883,20 @@ ACP has no field for a composer prefill, so the prediction travels outside the A
}
```
The key names no vendor, so another client can read it.
The key names no vendor.
The adapter sends it only to an AIR client; see the [compatibility rule](#compatibility-rule).
Any client that advertises `session.promptSuggestions` gets the same prediction as ACP's unstable `prompt_suggestions_update`, on v1 and v2:
```json
{
"sessionUpdate":"prompt_suggestions_update",
"suggestions":[{"prompt":[{"type":"text","text":"Run the tests"}]}]
}
```
An AIR client that advertises the capability gets both.
AIR shows the first non-blank `suggestions[].text` as gray text in an empty composer.
Tab fills the composer with it and sends nothing.
@@ -882,6 +907,11 @@ Tab fills the composer with it and sends nothing.
A prediction the next prompt outran — the user sent it before the adapter read the prediction off the SDK stream — is dropped instead of published.
`prompt_suggestions_update` follows two more rules of ACP, which the `_meta` form does not:
- a prediction that arrives while Claude works, such as on a prompt that was queued before the turn's result, is dropped;
- on v2, the list is withdrawn when foreground work starts without a prompt, such as a cycle that Claude Code starts after a background task ends.
The CLI predicts nothing on the first turn of a session, after an API error, in plan mode, and at the account's usage limit, so many turns end with no prediction.
A client must treat a turn without one as normal.
A caller can turn the whole feature off with `_meta.claudeCode.options.promptSuggestions: false` on `session/new`; a user can turn it off in Claude Code settings or with `CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=false`.
@@ -965,6 +995,58 @@ RUN_INTEGRATION_TESTS=true npx vitest run src/tests/model-presentation.test.ts
Review the changes to the Opus entries and labels before you update the version guard.
The live test only initializes the SDK. It sends no model prompt.
## Model reasoning efforts
The `reasoningEfforts` key lets a client show the effort levels of a model before the client selects that model.
The effort option shows only the levels of the current model.
### Activation
The adapter sends the key to every AIR client.
The key has no capability, because it only adds data.
A client that is not AIR gets no `reasoningEfforts`.
The key does not depend on `recommendedValue`.
### Entry metadata
Each entry of the `model` option gets the levels of its model at `_meta.jetbrains.air.reasoningEfforts`:
```json
{
"value":"claude-opus-5-5",
"name":"Opus 5.5",
"_meta":{
"jetbrains":{
"air":{
"version":1,
"reasoningEfforts":{
"values":["low","medium","high","xhigh","max"],
"recommended":"medium"
}
}
}
}
}
```
`values` are the `supportedEffortLevels` of the SDK `ModelInfo` of the entry, in the SDK order.
The effort option lists the same levels in the same order.
`values` never contain the `default` row of the effort option.
`recommended` is `medium` when the model offers it, else the first level.
The SDK names no recommended effort, so the adapter uses the rule of the effort option.
For the current model, `recommended` is the `recommendedValue` of the effort option.
The adapter finds the `ModelInfo` of an entry by its value.
The `default` entry gets the levels of the listed model that its `resolvedModel` names.
When no listed model has that `resolvedModel`, the `default` entry gets no `reasoningEfforts`.
A running model that the picker does not list gets its own entry, with the same lookup.
A model without effort support, or with no levels, gets no `reasoningEfforts`.
The entries carry the metadata in each answer that carries config options, on ACP v1 and v2.
These are `session/new`, `session/load` on v1, `session/resume`, `session/fork`, `session/set_config_option`, and `config_option_update`.
The `model` option of a subagent's session has no `reasoningEfforts`.
## Async tasks
Claude can run work in the background, for example a backgrounded Bash command or a workflow.
@@ -1034,7 +1116,8 @@ It ends `completed` at the result of the turn or at the SDK `idle` state, and `f
A coalesced placeholder result (`num_turns: 0`) does not end it.
A prompt that the turn takes in ends the task, because that prompt owns the turn now.
A stop request interrupts the turn instead of stopping an SDK task.
It returns `{ "stopped": false }` while a prompt waits for its turn, because the interrupt would drop that prompt.
A prompt that waits for its turn survives the stop and runs next.
It returns `{ "stopped": false }` only while a prompt waits and either Claude Code already took it into the turn or the CLI sends no message lifecycle frames.
### Stop request
@@ -1281,7 +1364,7 @@ A client without the capability gets the original transcript and no typed record
## Native subagent sessions
The adapter implements the draft [ACP subagent RFD](https://github.com/agentclientprotocol/agent-client-protocol/pull/1992).
The adapter implements ACP's [subagents](https://agentclientprotocol.com/protocol/v1/subagents).
This section covers only the AIR bridge.
- The canonical client field is `clientCapabilities.subagents: {}`.
@@ -1296,6 +1379,10 @@ This section covers only the AIR bridge.
The source is the `task_started` prompt, else the Agent or Task input `prompt`.
A resumed generation gets the SendMessage `message` text.
The field is absent when the adapter has no prompt. The adapter does not truncate it.
- A forked skill (`context: fork`, such as `/code-review`) is a child session too, without an Agent or Task call.
The parent of one that Claude runs with the Skill tool is the session that made the Skill call, which stays a tool call.
The parent of one that the user types is the root session.
Claude Code sends the output of a typed one only when the command ends: its `subagent_state_update` follows that output.
- Without either signal, Agent and Task stay ordinary tool calls. AIR gets `_meta.jetbrains.air.subagent: true` on them.
Child interactions stay on the root session.
- A client that uses the older `_meta["subagent-transcript"]` capability or the `forwardSubagentText` session option keeps the flat child transcript.
@@ -1645,7 +1732,7 @@ Claude Code sends the result of the turn when the main agent stops, also while s
### Hold without the capability
A client that does not declare `backgroundSubagents` gets the hold of issues #864 and #866.
A client that does not declare `backgroundSubagents` gets the hold of issues #864 and #866, unless it gets the RFD form of [subagent sessions](subagent-sessions.md).
The adapter keeps the `session/prompt` request open while a subagent that the turn started or resumed runs.
The subagent output, its permission requests and the followup summary of the model then go out inside the turn.
The turn ends at the followup result, at an `idle` with no live subagent, at `session/cancel`, or when the next prompt starts.
@@ -1732,6 +1819,18 @@ For AIR, the companion field also carries the same value under the root key `_me
Released AIR versions read only that key.
A client that is not AIR gets neither key.
For AIR on both protocol versions, the request also lists the companion field keys in `_meta.jetbrains.air.customAnswerFields`:
The Kotlin ACP SDK property models do not retain `_meta`.
The TypeScript v2 schema supports property metadata.
AIR reads the request list to show the companion with its question.
The field keys and the response content stay the same in both versions.
A client that is not AIR gets no `customAnswerFields` key.
## Load replay end
ACP v1 has no signal that the history replay of `session/load` is over, other than the response.
@@ -1794,6 +1893,48 @@ It adds this object to the `session/fork` request:
- With or without this object, the forked session runs once the response arrives, so the client can prompt it without `session/load` or `session/resume`.
A later load replays its history into it, and a later resume returns it. A load or resume with other settings (`cwd`, MCP servers, additional directories, or the session options in `_meta`) restarts it, as for any loaded session.
## Session rewind
AIR edits a user message by removing that message and everything after it from the provider's context, in the same session: same session id, no fork.
`_session/rewind` asks the agent for that, at a session cursor:
```json
{ "sessionId": "0f7c…", "cursorId": "before:<uuid of the user message>" }
```
The response is `{ "rewound": true }`, which means that the cut is live and persisted, or `{ "rewound": false, "reason": "<reason>" }` when the conversation was left as it was.
The client keeps its own history then.
- ACP v1 only. The agent advertises `sessionRewind` to a client that declares it, and then announces each `cursor_update` with the capabilities `{ "fork": {}, "rewind": {} }`, except a cursor whose resume point is before the newest compaction (`beforeCompaction`) and every cursor of a session whose context was cleared (`clearedContext`): those get `{ "fork": {} }`. Every other client gets `{ "fork": {} }` on all cursors, and the method is not found (`-32601`) for it. ACP v2 does not list `sessionRewind` and has no `_session/rewind`; it only honours a cut that v1 made.
- `cursorId` is one that the session announced with `rewind`: the cursor before a user message of its history. The first user message has no cursor, since Claude Code has no entry before it to resume at, so a client offers no edit for it.
- The adapter resumes the stored conversation of the session at the entry before the cursor's message (`resumeSessionAt`). The agent replaces its query with that resume and restores the model, mode, effort, agent and Fast mode as the user left them. Claude Code deletes nothing: the dropped entries stay in the transcript as an orphan branch, and the agent records the cut in `rewind.json` beside the session's `subagents/` directory before it replaces the query, and puts the file back as it was when the cut does not happen (`busy`, `backgroundWork` or `providerRefused` after the file was written). When putting it back fails, the request fails with an internal error instead of `rewound: false`: the rewind did not happen and its point could not be removed, so the next load of the session applies the cut. A failed cut then still resumes the conversation first, so the session can be prompted. A crash between the two leaves the point on disk: the next resume of the session applies the cut, and the client's next load replays the cut history.
- A live prompt is not reported to the client that sent it, so its cursor is anchored `after` the last entity the client holds. After a rewind it is the entity the client held before the removed message; if the agent holds no such record, the next prompt gets no cursor. When a turn reports no entity (it was cancelled or failed before any output, or it was a slash command), the next prompt's cursor has the same `after <entity>` anchor as the previous prompt's cursor, with a different `cursorId`: the client uses the latest.
- The cut also removes the cursors at and after it: the session no longer announces them, and a request that names one fails as an unknown cursor.
- The cut holds until the next prompt stores a branch from it. Until then, the agent applies `rewind.json` wherever it reads or resumes the session: a `session/load` (v1) or `session/resume` with a replay (v2) replays the history before the cut, with its cursors only; a restart of the query, a later load or resume, and a v2 resume continue at the cut; `session/fork` copies the history before it, also without a `cursorId`, and rejects a `cursorId` or `jetbrains.air.fork` message from the removed part with `-32602`. The first resume after that prompt removes the file. `session/options` neither reads nor writes it. When the cut cannot be prepared (the stored history or `rewind.json` cannot be read, or `rewind.json` is not a valid record), the load, resume, replay or fork fails with an internal error instead of using the whole conversation, and the client can retry; the point stays on disk.
- A rewind keeps the task list and the published session failures of the session. Its token totals start again, as they do after any restart of the query.
- No file change is reverted. The files stay as the removed turns left them.
- A prompt sent while the rewind runs waits for it, and runs on the rewound conversation.
| `busy` | Claude is working, a prompt is queued, Claude Code runs a cycle on its own, or a `/remote-control` command is in flight. AIR stops the turn before it sends the request. |
| `backgroundWork` | A background task or subagent runs. Closing the query would end it. |
| `beforeCompaction` | The message is before the newest compaction of the conversation: Claude Code resumes from that compaction on and finds no entry before it. |
| `clearedContext` | The session's context was cleared when a plan was accepted: the conversation went on in another Claude Code session. |
| `providerRefused` | Claude Code refused the cut, or the query could not restart with it. The agent resumed the conversation as it was, once, and the session can be prompted. |
| `persistFailed` | `rewind.json` could not be written. The conversation and the rewind point are unchanged: the query was not replaced. The transcript can gain the `last-prompt` line that any resume writes. |
When the removed message is the last user message, Claude Code also checks the removed range and refuses a cut that would remove what the client never saw, such as a message the session absorbed mid-turn.
The refusal is deterministic, so the agent never retries it.
If the recovery resume fails too, the request fails with an internal error, the session ends, and the client loads it again. When it fails because the account needs a sign-in, the request fails with `authRequired` and the session stays: the next prompt after the sign-in resumes it.
The request fails with `-32602` for:
- a `cursorId` that the session's history does not hold: an unknown id, an id that is no cursor, the first message, a message before the newest compaction when the history before it cannot be read (the fallback in `src/resumed-session.ts`), or one that an earlier rewind removed;
- a session id that names a subagent's child session.
A `sessionId` that is not held by the agent fails with `-32002`.
## Presentation hints
Each session mode and each value of the mode config option carries `_meta.jetbrains.air.kind`:
@@ -64,4 +64,6 @@ When an ACP client routes the agent through a gateway with `providers/set`, the
The model picker then offers only the SDK models whose resolved model the gateway lists, matched without dates, version suffixes (`-v1:0`), `-fast`, `@` suffixes, context hints (`[1m]`) and provider prefixes, after the `availableModels` allowlist above. On Bedrock, a model the CLI resolved to another region prefix is dropped as well. When the gateway does not list the model a session runs, that is the default model or a resumed session's last model, the session switches to the first remaining picker row.
A 4xx answer means the gateway has no listing: `providers/set` succeeds and nothing is narrowed. A failed listing (network error, a status other than 2xx or 4xx, unexpected body, the 10 s timeout, an invalid header, or a base URL with credentials) fails `providers/set` with a JSON-RPC internal error, and the previous provider stays in effect. A listing that matches no SDK model leaves the session with no model to offer: there is no model config option. Gateways set through `authenticate`, `vertex` providers, and native routing are not listed. Setting the same gateway again (the same protocol, base URL and headers) reuses its listing, unless it answered 4xx; `providers/set` and `providers/disable` apply in the order they arrive, and logout clears the routing after `claude auth logout`, including a `providers/set` still listing; `providers/disable` and logout drop it.
A 4xx answer means the gateway has no listing: `providers/set` succeeds and nothing is narrowed. A failed listing (network error, a status other than 2xx or 4xx, unexpected body, the 10 s timeout, an invalid header, or a base URL with credentials) fails `providers/set` with a JSON-RPC internal error, and the previous provider stays in effect. Gateways set through `authenticate`, `vertex` providers, and native routing are not listed. Setting the same gateway again (the same protocol, base URL and headers) reuses its listing, unless it answered 4xx; `providers/set` and `providers/disable` apply in the order they arrive, and logout clears the routing after `claude auth logout`, including a `providers/set` still listing; `providers/disable` and logout drop it.
If the listing matches none of the models Claude Code reports after the `availableModels` allowlist, session setup (`session/new`, `session/load`, `session/resume`, `session/fork`) fails with an internal error that says to choose a different provider. Open sessions also fail when they restart under that provider: v1 drops them and sends a session failure update to clients with AIR's `sessionFailure` capability; v2 stops their queries and answers later requests with that error and an instruction to resume the session. After choosing a compatible provider, use `session/resume` to continue a stopped v2 session. When no model matches, session setup still succeeds with no model config option if Claude Code reports no models or any allowed model row has no `resolvedModel` (for example an `availableModels` entry Claude Code does not report).
An ACP v1 or v2 client can poll `_session/read` while a terminal continues a Claude conversation. The adapter reads the transcript and its recorded subagents from disk. Claude Code and MCP servers stay in the writer process. The read sends ordinary `session/update` notifications and ends with a response.
Check `_meta.sessionRead.supported` in the initialize response. On v1 declare `clientCapabilities.session.cursors: {}` to receive read cursors. V2 supports them automatically.
1. Send `{"sessionId":"…","replayFrom":{"type":"start"}}`. Collect the replay and its root `cursor_update` with `capabilities.read`. On success, save the response's `cursorId` alongside the transcript. A session with no anchor returns `{}`. Poll it from the start until a cursor is available.
2. Send `{"sessionId":"…","replayFrom":{"type":"cursor","cursorId":"…"}}`. Append the updates and save the returned ID only after success. The cursor survives a reader restart with the same protocol, client capabilities, working directory and adapter version. An unchanged session returns the same ID. V2 sends the root `replay_complete` followed by a `session_info_update` with the current title. Apply the title even if the cursor stays the same. A null title clears the previous one. On v1, a change to an already replayed title invalidates the cursor.
3. If the read fails with `-32602` and `data.reason: "invalid_cursor"`, read from the start and replace the saved transcript on success. A rewind, compaction, or change to an already rendered tool call or subagent state can invalidate the prefix. On cancellation or a retryable read error, discard the staged updates and keep the last successful cursor.
Omitting `replayFrom` or setting it to `null` requests a full replay and returns `{}`. A v1 client without cursor support gets the same result from `start`. The optional absolute `cwd` overrides the working directory recorded in the root transcript for replay.
A missing transcript returns `-32002`. A session already open, opening, closing or being read on the same connection returns `-32600` with reason `session_already_open`. An unreadable history file returns `-32603` with reason `history_read_failed`. A read can also return a retryable error if the writer changes the history between the root and child scans.
## Polling cost and scope
A reader with a cached cursor for a root transcript checks the root file identity, size and timestamps, the rewind file, and the stored title when needed. When they match, it skips rendering history. This also covers sessions using Bash, PowerShell, Read, Write, Edit, Glob or Grep. Other tools can depend on child transcripts or workspace files, so their sessions take the full replay path. A reader restart, a pending rewind, or a change to the transcript or its title file also triggers full validation. A new or changed cursor is checked against a second render before delivery. Recorded children share the root request and can append independently. The unit of delivery is the whole suffix, including updates from recorded children. Clients can virtualize that history for display.
On the full replay path, each connection keeps the parsed records of the root and child transcripts that it read. A poll parses only the lines appended since the last read. It reuses the messages of each transcript that did not change. A transcript that got a new identity, got shorter, or changed its first or last 4 KB is parsed again in full. A connection keeps at most 1,024 files and 256 MB of transcript lines. At the limit, this costs about 200 to 340 MB of heap. To keep a new file, it drops only files that no read used in the last minute. So a session bigger than the limit keeps the same part from poll to poll, and the rest is parsed on each poll. A file that no read used for 5 minutes is dropped. A load, resume, close or delete drops the files of the session.
The title is the custom title from the transcript tail or `custom-title.json`, as in Claude’s session index. Otherwise it is the last `custom-title` record, or else the last `ai-title` record, of the whole captured transcript. The index reads only the first and last 64 KB of the file, so a large tool result would otherwise hide an unchanged title. The quiet check assumes the local filesystem updates file identity or timestamps on rewrites. The cursor describes the rendered transcript. For current session activity, AIR clients can use the [session index](air-extensions.md#session-index). For clients also talking to older adapters, a successful cursor request that returns `{}` means a full replay. Replace the saved view and clear the cursor.
A client switching from a live load to polling closes the session on its own connection and starts a fresh read.
A client that declares `clientCapabilities.subagents`, other than JetBrains AIR, gets each Agent or
Task subagent as its own child session, following the [subagents RFD](https://github.com/agentclientprotocol/agent-client-protocol/blob/main/docs/rfds/subagents.mdx):
Task subagent as its own child session, following ACP's [subagents](https://agentclientprotocol.com/protocol/v1/subagents):
-`subagent_update` on the parent announces the child before any of its traffic, with the
parent's `title` and `description` for it, and reports its work state: `running`,
@@ -20,8 +20,8 @@ Task subagent as its own child session, following the [subagents RFD](https://gi
first model request. It sends `cwd: null` when the child is back in its parent's directory. A
child in its parent's directory gets no `cwd`, and no child gets `additionalDirectories`: Claude
Code gives a subagent the session's additional directories, so it inherits them. A replay
announces a child with the `cwd` that its transcript recorded, and clears it after the response
when that directory no longer exists.
announces a child with the `cwd` that its transcript recorded, and clears it with the child's
current state (see below) when that directory no longer exists.
- Session messages replace the Agent or Task call that launches the child, which its parent is
not shown:
- The launch's prompt is a `session_message` in both transcripts: the parent's outgoing view and
@@ -32,6 +32,30 @@ Task subagent as its own child session, following the [subagents RFD](https://gi
message to the parent instead, in both transcripts and linked the same way.
- A launch whose child is never exposed is shown as a tool call after all, with its final
status.
- A forked skill (a skill with `context: fork`, such as `/code-review`) is a child session too.
Claude Code runs it as a subagent that no Agent or Task call launched:
- When Claude runs it with the Skill tool, the child is announced on the session that made the
Skill call, once Claude Code reports its task. The Skill call stays a tool call of that session,
with the skill's result. The skill's prompt is a `session_message` in the child's transcript
only, with the Skill call's tool use id.
- When the user types it, there is no call: the child is announced on the root session, and the
command's output is the root's message. Claude Code (2.1.328) sends such a child's messages
only when the command ends, after it reports the task's end. The adapter keeps the child
`running` until they came, so its `idle` follows its tool calls and text. They all arrive at
once: the child's transcript is not live.
- A subagent that a typed skill launches gets no session: Claude Code reports the end of its
task before the Agent call that launched it. That call is a tool call of the skill's child,
with its final status.
- After a `session/cancel` of the root session, a typed skill's messages are the output of
stopped work, which the adapter drops: the child reports `idle` with `cancelled` and no more.
After a `session/cancel` of the child itself, they still go to the child, before its `idle`
with `cancelled`.
- A replay shows no child for a forked skill. The Skill call stays a tool call.
- On v1, the parent's prompt turn ends at its result, also while a background child that it
launched or resumed still runs. The child's updates and requests follow the prompt response: the
RFD has a client keep receiving child events after it. The parent's summary when the child ends
comes from a followup cycle out of a turn. Its result ends no turn, and a plan approval it asks
for has no clear-context option.
- A SendMessage call that resumes the child is not shown either. Its message is a
`session_message` in both transcripts, the sender's outgoing view and the child's incoming one,
linked like a launch's prompt. A SendMessage call whose message resumes no announced child,
@@ -43,10 +67,11 @@ Task subagent as its own child session, following the [subagents RFD](https://gi
carries the RFD's `session` content, `{ "type": "session", "sessionId": "<child>" }`, after its
other content: a TaskStop call whose `task_id`, or a SendMessage call whose `to`, is the child's
agent id; a SendMessage call that resumed the child and stays shown because a permission request
showed it first; and, on v1, an Agent or Task call that stays shown for the same reason. A
`tool_call_update` without content carries none, since it would replace the content the client
holds. A call that names the child by its name gets no reference: Claude Code resolves the
name, and the adapter cannot tell which agent it picked.
showed it first; on v1, an Agent or Task call that stays shown for the same reason; and the
Skill call that launched a forked skill's child. A `tool_call_update` without content carries
none, since it would replace the content the client holds. A call that names the child by its
name gets no reference: Claude Code resolves the name, and the adapter cannot tell which agent it
picked.
-`session/cancel` on the parent interrupts Claude Code, which stops the foreground children that
the turn waits on. Background children keep running, as the RFD prefers; a client stops one with
its own `cancel`. Each stopped child reports `idle` with `cancelled` from Claude Code's own
@@ -65,9 +90,22 @@ Task subagent as its own child session, following the [subagents RFD](https://gi
guessing its parent.
- A replay restores each child under its live session id, from its own transcript, with the same
session messages and `session` references as live, and its end is an `idle` before the response.
Each replayed child's current state follows the response.
Each replayed child's current state follows the response: on v1, the response is what separates
a replayed child state from a current one.
A replay sends no `config_option_update` of a child, since one that arrives before the response
is a past value to the client. Each replayed child's configuration follows its current state:
the configuration of a child that still runs, else its `model` option with the model of the
latest response in its transcript, as the session's `model` option names it. A child that
neither runs nor has a response gets none.
A launch without Claude Code's metadata file for the child stays an ordinary tool call of the
parent, and a notice, for a client that takes notices, says that subagent history is missing.
- A session that is loaded or resumed with the same settings while it runs keeps its children's
runs. After the response, each child that works and that no replay announced is announced
again on its parent, with its labels, the `cancel` capability and its state, and then gets the
configuration that the client last had for it: every working child after a `session/resume`,
which replays nothing, and after a `session/load` a child whose launch the history does not
have, such as a forked skill's. A child that no longer works but has a working child of its own
is named first, with its labels only.
- After a load or resume, with or without replay, a SendMessage that resumes an agent from before
it runs that agent in its session from before. Before the agent's traffic, each of its ancestors
that the client was not told about in this connection is announced, parent before child and
@@ -78,13 +116,27 @@ Task subagent as its own child session, following the [subagents RFD](https://gi
parent's: Claude Code also stops the foreground children it waits on, and the parent's turn goes
on. Each stopped child reports `idle` with `cancelled` from Claude Code's own events, and its
requests that the stop withdraws report no `running` first. A replayed child, which no longer
runs, gets no capabilities. A client cannot prompt or otherwise change a child.
runs, gets no capabilities, and a `session/cancel` of it does nothing. A client cannot prompt or
otherwise change a child: any other request that names a child fails with `-32602` (Invalid
params), `session/close` and `session/delete` too. That holds for every child that a
`subagent_update` announced, while it ran or in a replay, until the client closes the child's
root session: also after `/clear` and after a restart of the root's Claude Code process.
An [ACP v2](../README.md#experimental-acp-v2) client gets the same without declaring anything, since subagents
An [ACP v2](../README.md#acp-v2-preview) client gets the same without declaring anything, since subagents
are part of v2's baseline. Each child also reports its work state as its own `state_update`, right
after the parent's copy. A replay ends each child's history with a `replay_complete` on the child's
session, before the child's `idle`. The notice that subagent history is missing follows the
parent's `replay_complete`.
session. On v2, the parent's `replay_complete` is what separates a replayed child state from a
current one, so each replayed child's current state follows the root session's `replay_complete`
and comes before the response: on its parent, with the cleared `cwd`, and then as the child's own
`idle`. The child's configuration follows it there, since v2 asks an agent not to replay a past
`config_option_update`. The notice that subagent history is missing follows the root's
`replay_complete` too.
On v2, a resume of the active session that replays can meet a child that the stored history does
not launch: a forked skill's child, or a subagent that Claude launched after the history was written.
Such a child is announced again right after the root's `replay_complete`, when it works, when its
parent lists it, or when the replay held one of its updates. Its own `replay_complete` follows at
once, since its replay is empty, and then come the updates that the replay held.
JetBrains AIR keeps the earlier draft of the RFD (`subagent_spawned`, `subagent_state_update`),
which it enables with `nativeSubagentSessions` in `_meta.jetbrains.air.capabilities`. See
`The Claude Code that CLAUDE_CODE_EXECUTABLE names (${named}) is too old: it cannot take a session's MCP servers and settings over stdin. Update it to 2.1.328 or newer, or unset CLAUDE_CODE_EXECUTABLE to use the Claude Code that comes with the adapter.`,
`Session ${params.sessionId} has no cursor ${params.cursorId} that a fork can start at. Use a cursor that the session announced with the fork capability, or send the request without cursorId to fork the whole session.`,
/** The names of the plugins the session has after a reload; with `applied`. */
plugins?: string[];
/** Why the reload failed; with `failed`. */
error?: string;
};
exportinterfacePluginCommandResult{
ok: boolean;
operation: PluginOperation;
/** The CLI's own message, or the adapter's when the CLI did not run or did not answer. */
message: string;
/** The CLI's `failureCode`, such as `not_found` or `command_source_refused`. */
failureCode?: string;
/** With `command_source_refused`: the command that the marketplace declares as the install. */
shownCommand?: string;
/** With `shownCommand`: the terminal command that lets the user confirm it. */
terminalCommand?: string;
/** The parsed `--json` output of a list: an array, or `{installed, available}`; for an overview, `{plugins, marketplaces}` plus `pluginsError` or `marketplacesError` for a list that failed. */
data?: unknown;
reload?: PluginReload;
}
exportinterfaceExecOptions{
cwd: string;
env: Record<string,string|undefined>;
signal: AbortSignal;
timeoutMs: number;
}
exportinterfaceExecOutput{
stdout: string;
stderr: string;
/** The exit code. A run that ends with a non-zero code is a result, not an error. */
code: number;
}
/** Runs a program without a shell. Rejects when it cannot start, is aborted,
"The session was not started, because Claude Code did not take its provider or gateway route. Try again, or set the provider or the gateway login again.",
return`Claude Code skipped ${skipped}, so its permission rules, sandbox settings and hooks would not apply. Fix the file and start the session again.`;
}
return`Claude Code skipped ${skipped}, so their permission rules, sandbox settings and hooks would not apply. Fix the files and start the session again.`;
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"AskUserQuestion"}},"content":[],"kind":"other","name":"AskUserQuestion","sessionUpdate":"tool_call","status":"pending","title":"Asking for your input","toolCallId":"toolu_ask"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawInput":{"questions":[{"header":"Database","multiSelect":false,"options":[{"description":"Relational","label":"Postgres","preview":"CREATE TABLE t ();"},{"description":"Key-value","label":"Redis"}],"question":"Which database?"}]},"sessionUpdate":"tool_call_update","toolCallId":"toolu_ask"}}}
{"kind":"createElicitation","payload":{"message":"Which database?","mode":"form","requestedSchema":{"properties":{"question_0":{"oneOf":[{"_meta":{"_claude/askUserQuestionOption":{"preview":"CREATE TABLE t ();"}},"const":"Postgres","description":"Relational","title":"Postgres"},{"const":"Redis","description":"Key-value","title":"Redis"}],"title":"Database","type":"string"},"question_0_custom":{"_meta":{"_askUserQuestionCustomAnswer":{"isCustomAnswer":true,"questionId":"question_0"},"jetbrains":{"air":{"customAnswer":{"isCustomAnswer":true,"questionId":"question_0"},"version":1}}},"description":"Type your own answer, or add a note to the option you chose above (optional).","title":"Other","type":"string"}},"type":"object"},"sessionId":"<session>","toolCallId":"toolu_ask"}}
{"kind":"createElicitation","payload":{"_meta":{"jetbrains":{"air":{"customAnswerFields":["question_0_custom"],"version":1}}},"message":"Which database?","mode":"form","requestedSchema":{"properties":{"question_0":{"oneOf":[{"_meta":{"_claude/askUserQuestionOption":{"preview":"CREATE TABLE t ();"}},"const":"Postgres","description":"Relational","title":"Postgres"},{"const":"Redis","description":"Key-value","title":"Redis"}],"title":"Database","type":"string"},"question_0_custom":{"_meta":{"_askUserQuestionCustomAnswer":{"isCustomAnswer":true,"questionId":"question_0"},"jetbrains":{"air":{"customAnswer":{"isCustomAnswer":true,"questionId":"question_0"},"version":1}}},"description":"Type your own answer, or add a note to the option you chose above (optional).","title":"Other","type":"string"}},"type":"object"},"sessionId":"<session>","toolCallId":"toolu_ask"}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":[{"content":{"text":"User has answered your questions: \"Which database?\"=\"Postgres\".","type":"text"},"type":"content"}],"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_ask"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"asyncTaskId":"workflow_3","canStop":true,"description":"Watch the logs","name":"Watch the logs","sessionUpdate":"async_task_spawned","showInTranscript":true,"taskType":"workflow","toolCallId":"toolu_workflow"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"jetbrains":{"air":{"contextCompaction":{"error":"Context too small","version":1}}}},"content":[{"content":{"text":"Compaction failed: Context too small","type":"text"},"type":"content"}],"sessionUpdate":"tool_call_update","status":"failed","toolCallId":"00000000-0000-4000-8000-000000000001"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawInput":{"plan":"# Plan\n1. Do it"},"sessionUpdate":"tool_call_update","toolCallId":"toolu_plan"}}}
{"kind":"requestPermission","payload":{"_meta":{"jetbrains":{"air":{"permission":{"title":"Ready to code?","version":1},"version":1}}},"options":[{"kind":"allow_once","name":"Yes, manually approve edits","optionId":"exit-plan-default"},{"kind":"allow_always","name":"Yes, clear context (0% used) and use auto mode","optionId":"exit-plan-clear-auto"},{"kind":"allow_always","name":"Yes, and use auto mode","optionId":"exit-plan-auto"},{"kind":"allow_always","name":"Yes, and bypass permissions","optionId":"exit-plan-bypass"},{"kind":"reject_once","name":"No, keep planning","optionId":"reject"}],"sessionId":"<session>","toolCall":{"rawInput":{"plan":"# Plan\n1. Do it"},"title":"Approve Plan","toolCallId":"toolu_plan"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"configOptions":[{"category":"mode","currentValue":"default","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionUpdate":"config_option_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"configOptions":[{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","currentValue":"default","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionUpdate":"config_option_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"tool_call_update","status":"completed","title":"Exited Plan Mode","toolCallId":"toolu_plan"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"jetbrains":{"air":{"goal":{"controlMethod":"_session/goal","objective":"Ship the feature","status":"active"},"version":1}}},"sessionUpdate":"session_info_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"locations":[{"path":"<cwd>/n.ipynb"}],"sessionUpdate":"tool_call_update","title":"Edit cell in n.ipynb","toolCallId":"toolu_nb"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"Fix the bug","type":"text"},"messageId":"00000000-0000-4000-8000-00000000c001","sessionUpdate":"user_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"Check the file.","type":"text"},"messageId":"msg_r1","sessionUpdate":"agent_thought_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"I will edit it.","type":"text"},"messageId":"msg_r1","sessionUpdate":"agent_message_chunk"}}}
{"kind":"loadSession","payload":{"configOptions":[{"category":"mode","currentValue":"auto","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"auto"},"sessionId":"<session>"}}
{"kind":"loadSession","payload":{"configOptions":[{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","currentValue":"auto","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"auto"},"sessionId":"<session>"}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"newSession","payload":{"configOptions":[{"category":"mode","currentValue":"auto","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"auto"},"sessionId":"<session>"}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"newSession","payload":{"configOptions":[{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","currentValue":"auto","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"auto"},"sessionId":"<session>"}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"capabilities":{},"name":"Background review","prompt":"Review the diff","sessionUpdate":"subagent_spawned","subagentSessionId":"a2","task":"Review the diff"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"capabilities":{},"name":"Check the logs","prompt":"Check logs","sessionUpdate":"subagent_spawned","subagentSessionId":"agent_late","task":"Check logs"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"capabilities":{},"name":"Fix the build","prompt":"Make the build pass","sessionUpdate":"subagent_spawned","subagentSessionId":"agent_n","task":"Make the build pass"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"capabilities":{},"name":"Plan the work","prompt":"Plan it","sessionUpdate":"subagent_spawned","subagentSessionId":"agent_outer","task":"Plan it"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"capabilities":{},"name":"Explore code","prompt":"Find the parser","sessionUpdate":"subagent_spawned","subagentSessionId":"agent_1","task":"Find the parser"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"capabilities":{},"name":"Summarize","prompt":"Summarize the repo","sessionUpdate":"subagent_spawned","subagentSessionId":"agent_t","task":"Summarize the repo"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"Let me thin","type":"text"},"messageId":"msg_text","sessionUpdate":"agent_thought_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"k about it.","type":"text"},"messageId":"msg_text","sessionUpdate":"agent_thought_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.