Compare commits

...

8 Commits

Author SHA1 Message Date
acp-release-bot[bot]
51f514d73c chore(main): release 0.106.0 (#1588)
🤖 I have created a release *beep* *boop*
---


##
[0.106.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.105.0...v0.106.0)
(2026-11-10)


### Features

* report the auth detail as the account's description
([#1591](https://github.com/agentclientprotocol/claude-agent-acp/issues/1591))
([f6d6429](f6d6429187))
* serve session/options and initial config options
([#1592](https://github.com/agentclientprotocol/claude-agent-acp/issues/1592))
([b1763c7](b1763c750a))


### Bug Fixes

* honour the client's settings option in idle compaction
([#1555](https://github.com/agentclientprotocol/claude-agent-acp/issues/1555))
([b73ee49](b73ee491c8))
* replay the messages before each compaction on ACP v1 and v2
([#1430](https://github.com/agentclientprotocol/claude-agent-acp/issues/1430))
([626015b](626015bf81))
* stop the release executable from loading the project's .env and
bunfig.toml
([#1589](https://github.com/agentclientprotocol/claude-agent-acp/issues/1589))
([4a3ff6a](4a3ff6a1eb))
* update to @agentclientprotocol/sdk 2.6.0
([#1590](https://github.com/agentclientprotocol/claude-agent-acp/issues/1590))
([9fca22a](9fca22a03b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: acp-release-bot[bot] <246668977+acp-release-bot[bot]@users.noreply.github.com>
2026-11-10 22:45:08 +00:00
Ben Brandt
b1763c750a feat: serve session/options and initial config options (#1592)
Implements the unstable [Session options
RFD](https://agentclientprotocol.com/rfds/session-options) on ACP v1 and
v2. Both cores advertise the `options` session capability.

## `session/options`

Answers with what a session would start with: modes and config options
on v1, config options and commands on v2.

- A session that the connection holds answers with what it has now.
- Otherwise a query starts as the session's would, without MCP servers,
and closes once its options are read. With `sessionId` it resumes that
session, and an unknown one fails with `-32002`.
- It sends no update and registers no session.

Claude Code only reports its models, modes and agents from a running
process, so there is no way to answer without starting one. The query
runs with `persistSession: false`, so it stores no session and does not
write to a resumed transcript. Two consequences: each call costs a CLI
start, and the user's `SessionStart` hooks run in it. The v2 commands
lack MCP prompts, which the RFD allows.

On v1 this is an `optionsOnly` exit in `createSession`, after the config
options are built and before the session is registered. On v2,
`launchSession` is split into `openQuery` (start the query, build the
config) and the part that makes the session active, and
`session/options` uses only the first.

## Initial `configOptions`

`session/new`, `session/load` (v1) and `session/resume` take
`configOptions`. They are set in list order through the same code as
`session/set_config_option`, so a model entry decides which effort
levels a later entry can pick.

- Two entries with the same `configId` fail with `-32602` before a query
starts. So does a value type that v2 does not take.
- An entry with an unknown `configId`, a value of another type, or a
value the option does not offer is skipped. An entry that Claude Code
refuses is skipped and logged.
- No update goes out for the entries. The response carries the modes and
options, and the warning of an Auto mode fallback waits for the next
prompt, as it does at a session's start.

`session/fork` does not take them yet: the schema has no field for it.
agentclientprotocol/agent-client-protocol#2794 adds one.

## Testing

New tests in `src/tests/v1/create-session-options.test.ts` and
`src/tests/v2/v2.test.ts` cover both versions. The scenario golden files
change only by the new capability in `initialize`.

Not verified against a real Claude Code yet: `persistSession: false`
together with `resume`. The tests run against the mocked SDK.
2026-11-10 22:42:28 +00:00
Ben Brandt
f6d6429187 feat: report the auth detail as the account's description (#1591)
Stacked on the SDK 2.6.0 update (`acp-sdk-2.6.0`). Merge that first.

`auth/status` and `auth/status_update` carried the detail of an account,
such as the key source or the gateway host, in parentheses in its label:
`Anthropic API key (ANTHROPIC_API_KEY)`. SDK 2.6.0 adds
`AuthAccount.description` for it, so the account is now `label:
"Anthropic API key"` with `description: "ANTHROPIC_API_KEY"`.

`_meta.claudeCode.detail` still carries the detail for clients that read
it there. A client that shows only `label` no longer shows the detail.

The mapping is shared, so v1 and v2 both change.
`docs/air-extensions.md` is updated.
2026-11-10 22:34:49 +00:00
Ben Brandt
9fca22a03b fix: update to @agentclientprotocol/sdk 2.6.0 (#1590)
Updates `@agentclientprotocol/sdk` from 2.5.0 to 2.6.0 (schema v1.31.0
and v2.0.0-alpha.15).

The new schema adds `configOptions` to session setup requests. The v2
core converts a setup request to its v1 form, and the v2 entries are not
assignable to the v1 type, so `v1NewSessionRequest` leaves them out.
Nothing reads them yet: a Client only sends them to an Agent that
advertises `session.options`. #1592 serves them.

No behavior change. `npm run check`, `npm run build` and `npm run
test:run` pass.
2026-11-10 22:34:49 +00:00
Ben Brandt
4a3ff6a1eb fix: stop the release executable from loading the project's .env and bunfig.toml (#1589)
Fixes #1579.

## Problem

The release executable is built with `bun build --compile`. By default a
compiled Bun executable loads `.env`, `.env.local` and `bunfig.toml`
from its working directory at startup. The editor starts the agent in
the user's project, so:

- The project's dotenv values land in the agent's `process.env` and are
passed on to Claude and every Bash command as real environment
variables. Most frameworks never override a variable that is already
set, so the project's own `.env.test` is silently ignored. In the
reported case this made a test suite drop the dev database.
- A `bunfig.toml` in the project that Bun cannot parse stops the agent
from starting (`SyntaxError: An error occurred while parsing code`, exit
1).

Only the executable is affected; running the npm package under Node does
not load these files.

## Fix

`scripts/build-binary.mjs` passes `--no-compile-autoload-dotenv` and
`--no-compile-autoload-bunfig`. Bun's other two autoloads
(`tsconfig.json`, `package.json`) are already off by default.

## Testing

`scripts/smoke-binary.mjs` gains a check that runs the executable in a
directory containing a `.env`, a `.env.local` and an unparseable
`bunfig.toml`, with Node standing in for `claude` to print the
environment the CLI is spawned with. It fails on an executable built
without the flags and passes with them.

Run locally on macOS arm64 only; the Linux, Alpine and Windows targets
are covered by the `binaries.yml` matrix.
2026-11-10 21:27:42 +00:00
Erdős Péter
b73ee491c8 fix: honour the client's settings option in idle compaction (#1555)
## Problem

A client can pass Claude Code settings in
`_meta.claudeCode.options.settings`, and the CLI gets them as
`--settings`. Idle compaction ignored them: it read only
`settingsManager.getSettings()`, the settings files. A client that sent
`{ idleCompaction: false }` still got `/compact` after about 54 idle
minutes, though the CLI had the setting off. The same went for
`autoCompactEnabled` and the `env` block (`DISABLE_COMPACT`,
`DISABLE_AUTO_COMPACT`, `CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS`). This
affected both ACP v1 and v2.

## Change

- `SettingsManager.getCompactionSettings(override)` resolves
`idleCompaction`, `autoCompactEnabled` and `env` in the CLI's order:
managed settings, then `--settings`, then the user/project/local files.
`env` merges entry by entry. An `undefined` value in the override does
not hide the files' value. This sits next to `getApiKeyHelper` and
`getModelSelectionSettings`, which already take the override the same
way.
- v1 (`src/v1/acp-agent.ts`) and v2 (`src/v2/reports.ts`, via
`ReportsSetup.configuredSettings`) pass the client's settings to it.
`IdleCompaction` itself is unchanged.

## Tests

- `settings-api-key-helper.test.ts`: managed > override > files for each
key and each `env` entry; an `undefined` override key keeps the files'
value.
- `v1/idle-compaction-agent.test.ts` and `v2/acp-v2.test.ts`: a session
started with `settings: { idleCompaction: false }` gets no `/compact`.
Both fail without the wiring change.

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Erdős Péter <6430206+sodre90@users.noreply.github.com>
2026-11-10 21:24:24 +00:00
Hussain Hammad
626015bf81 fix: replay the messages before each compaction on ACP v1 and v2 (#1430)
Fixes #1297.

After `/compact`, `session/load` replays from the summary of the last
compaction only. `getSessionMessages` follows `parentUuid` links, and
Claude Code writes each `compact_boundary` with `parentUuid: null`, so
the chain ends there. The messages before it are still in the `.jsonl`,
and the boundary still links the last one of them in
`logicalParentUuid`; nothing follows that link. The spec requires the
agent to "replay the entire conversation", and the replay test `replays
a compaction as one completed compaction_update at its position`
(`v2/acp-v2.test.ts`) already mocks a prompt before the summary, which
the real SDK never returns.

This now happens without `/compact` too: since #1522, idle sessions
compact on their own. It reproduces in Zed as well
([zed-industries/zed#66523](https://github.com/zed-industries/zed/issues/66523#issuecomment-6644375981)).

- When the chain starts at a compact summary, replay reads the
transcript again through `readHistoryAcrossCompactions`
(`resumed-session.ts`). It loads every record with
`loadFullSessionHistory`, which moves from `fork-session.ts` (where it
reads the inactive branches for the same reason) to sit beside
`findTranscript`. It links each boundary to its `logicalParentUuid` and
passes the records back to `getSessionMessages` as a `sessionStore`. The
SDK's own parsing (queued commands, meta messages, deliveries) is
unchanged.
- The boundary's `preservedSegment` and `preservedMessages` are dropped.
With them, `getSessionMessages` moves the messages a compaction kept to
after the summary, and the relinked boundary then leads from them back
to the summary, so the chain loops and ends there. Without them, the
kept messages replay once, where they were said.
- The v1 agent's `session/load` and the v2 agent's replay both read the
history this way.
- A session without a compaction reads its transcript once, as before.
Resume, fork and rewind still use the active chain. If the second read
fails, replay logs it and sends the active chain, as it does today.

## Testing

- `npm run check` and `npm run build` pass. `npm run test:run` passes
except for 2 tests that fail the same way on `main` on this machine:
`v1/acp-scenarios.test.ts > normalize > replaces only the version of
this adapter and the path of this Node binary` (Node at
`/usr/bin/node`), and `v2/v2.test.ts > lists bypass before auto in
ExitPlanMode's options after plan mode left bypass` (this machine runs
as root, where bypass is not offered).
- New: `compacted session replay` (`v1/acp-agent.test.ts`) replays a
real transcript file with one `/compact` between two prompts to a client
that declares `session.compaction`. It fails on `main` without this
change: the replay has no "hi" and no "Hello".
- New: `replays the messages before a compaction from the transcript`
(`v2/v2.test.ts`) resumes the same transcript on v2 with `replayFrom:
start`. Without the change, the replay has no user message before the
compaction.
- New: `readHistoryAcrossCompactions` (`resumed-session.test.ts`) covers
two compactions, a compaction with both forms of preserved metadata as
Claude Code 2.1.293 writes them, and a session without a compaction.
- On 10 local transcripts with 1 to 10 compactions, no message replays
twice. 9 of them now replay from the first prompt with one summary per
compaction, for example 414 → 1925 messages and 909 → 3693. The tenth
has many records written a second time, and replays 5 of its 10
compactions (1428 → 7526 messages). The second read took 4–220 ms, and
745 ms for that 33,000-line transcript.
- Rechecked with 4 transcripts written by Claude Code 2.1.280 to
2.1.318, with 1, 2, 3 and 6 compactions. `session/load` sends one
`compaction_update` per compaction, where `main` sends only the last
one; for the 6-compaction transcript `main` replays nothing before the
last summary. No summary replays as a user message and no tool call
replays twice.

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-11-10 22:10:24 +01:00
acp-release-bot[bot]
1ffbb6b577 chore(main): release 0.105.0 (#1583)
🤖 I have created a release *beep* *boop*
---


##
[0.105.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.104.1...v0.105.0)
(2026-11-10)


### Features

* serve session/set_title on ACP v1 and v2
([#1585](https://github.com/agentclientprotocol/claude-agent-acp/issues/1585))
([a4a8534](a4a8534c23))
* serve session/status on v1 and v2
([#1584](https://github.com/agentclientprotocol/claude-agent-acp/issues/1584))
([6bc2e05](6bc2e058cb))


### Bug Fixes

* include inline model settings in the model picker
([#1488](https://github.com/agentclientprotocol/claude-agent-acp/issues/1488))
([36cb674](36cb674589))
* keep a v2 session idle when the model changes between turns
([#1586](https://github.com/agentclientprotocol/claude-agent-acp/issues/1586))
([f5d7916](f5d79167a6))
* report Claude Code's API error message as a notice in v2
([#1582](https://github.com/agentclientprotocol/claude-agent-acp/issues/1582))
([99cc1f3](99cc1f3245))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: acp-release-bot[bot] <246668977+acp-release-bot[bot]@users.noreply.github.com>
2026-11-10 21:51:06 +01:00
74 changed files with 1719 additions and 176 deletions

View File

@@ -1,3 +1,3 @@
{
".": "0.104.1"
".": "0.106.0"
}

View File

@@ -1,5 +1,36 @@
# Changelog
## [0.106.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.105.0...v0.106.0) (2026-11-10)
### Features
* report the auth detail as the account's description ([#1591](https://github.com/agentclientprotocol/claude-agent-acp/issues/1591)) ([f6d6429](https://github.com/agentclientprotocol/claude-agent-acp/commit/f6d64291876177f9f593415abfc7e50eb7e7ff56))
* serve session/options and initial config options ([#1592](https://github.com/agentclientprotocol/claude-agent-acp/issues/1592)) ([b1763c7](https://github.com/agentclientprotocol/claude-agent-acp/commit/b1763c750aef83fd05ce16901ff1a0d9b4b90234))
### Bug Fixes
* honour the client's settings option in idle compaction ([#1555](https://github.com/agentclientprotocol/claude-agent-acp/issues/1555)) ([b73ee49](https://github.com/agentclientprotocol/claude-agent-acp/commit/b73ee491c8f60a1584a95a7f03557f356e1a991c))
* replay the messages before each compaction on ACP v1 and v2 ([#1430](https://github.com/agentclientprotocol/claude-agent-acp/issues/1430)) ([626015b](https://github.com/agentclientprotocol/claude-agent-acp/commit/626015bf81fd34f952406ae77bf60feb9ca39a16))
* stop the release executable from loading the project's .env and bunfig.toml ([#1589](https://github.com/agentclientprotocol/claude-agent-acp/issues/1589)) ([4a3ff6a](https://github.com/agentclientprotocol/claude-agent-acp/commit/4a3ff6a1eb16075b96676616ab2bbb98694a4d24))
* update to @agentclientprotocol/sdk 2.6.0 ([#1590](https://github.com/agentclientprotocol/claude-agent-acp/issues/1590)) ([9fca22a](https://github.com/agentclientprotocol/claude-agent-acp/commit/9fca22a03bdec5dc265bfdc42df316fb286a8142))
## [0.105.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.104.1...v0.105.0) (2026-11-10)
### Features
* serve session/set_title on ACP v1 and v2 ([#1585](https://github.com/agentclientprotocol/claude-agent-acp/issues/1585)) ([a4a8534](https://github.com/agentclientprotocol/claude-agent-acp/commit/a4a8534c23b08cdfd7f656d25f9ab16068fd8ffd))
* serve session/status on v1 and v2 ([#1584](https://github.com/agentclientprotocol/claude-agent-acp/issues/1584)) ([6bc2e05](https://github.com/agentclientprotocol/claude-agent-acp/commit/6bc2e058cb27624b4307462ac46167535af400d1))
### Bug Fixes
* include inline model settings in the model picker ([#1488](https://github.com/agentclientprotocol/claude-agent-acp/issues/1488)) ([36cb674](https://github.com/agentclientprotocol/claude-agent-acp/commit/36cb6745897bf9dabcb967b54233c42b860436b3))
* keep a v2 session idle when the model changes between turns ([#1586](https://github.com/agentclientprotocol/claude-agent-acp/issues/1586)) ([f5d7916](https://github.com/agentclientprotocol/claude-agent-acp/commit/f5d79167a649737bdeb1ce3b55ad449a34bb9d47))
* report Claude Code's API error message as a notice in v2 ([#1582](https://github.com/agentclientprotocol/claude-agent-acp/issues/1582)) ([99cc1f3](https://github.com/agentclientprotocol/claude-agent-acp/commit/99cc1f324586fad07f1da14bb9764cd16c64e920))
## [0.104.1](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.104.0...v0.104.1) (2026-11-10)

View File

@@ -140,7 +140,8 @@ for v2 is negotiated down to v1. With `v2`, the adapter rejects the `initialize`
On v2 the adapter serves the session baseline (`session/new`, `session/list`, `session/resume`
with replay, `session/close`, `session/prompt`, `session/cancel`), `session/delete`,
`session/fork`, `session/status`, `session/set_title`, additional directories, config options (the mode is one), plans, notices,
`session/fork`, `session/status`, `session/options` (with initial `configOptions` on `session/new` and
`session/resume`), `session/set_title`, additional directories, config options (the mode is one), plans, notices,
compaction, display terminals for commands, permission requests, elicitation, providers, auth, and
[subagents](#subagent-sessions). Steering is v1 only for now.

View File

@@ -228,7 +228,7 @@ 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 `label` also carries a `detail` in parentheses, e.g. `Anthropic API key (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` 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.
A command containing the whole word `central` and the word sequence `proxy start` is displayed as:

12
package-lock.json generated
View File

@@ -1,15 +1,15 @@
{
"name": "@agentclientprotocol/claude-agent-acp",
"version": "0.104.1",
"version": "0.106.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@agentclientprotocol/claude-agent-acp",
"version": "0.104.1",
"version": "0.106.0",
"license": "Apache-2.0",
"dependencies": {
"@agentclientprotocol/sdk": "2.5.0",
"@agentclientprotocol/sdk": "2.6.0",
"@anthropic-ai/claude-agent-sdk": "0.3.322",
"diff": "9.0.0",
"zod": "4.6.7"
@@ -38,9 +38,9 @@
}
},
"node_modules/@agentclientprotocol/sdk": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/@agentclientprotocol/sdk/-/sdk-2.5.0.tgz",
"integrity": "sha512-MFlXeIuwN6nZSK45SAsSnVjbLgQ2r4fnthoF1lQoGJP3PdaPRpOZeCF2Dds8S4cN8yZP5QbxB1bkJccGskmcYw==",
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/@agentclientprotocol/sdk/-/sdk-2.6.0.tgz",
"integrity": "sha512-3FtL6MkAV5F9qxg0FQV8wmBszIm2xuVPoDWOILIFSDQ+Vq3Twdh7Cw6Hk2GOPUbevgrTUpUAqZXQy7Geaj79mw==",
"license": "Apache-2.0",
"peerDependencies": {
"@modelcontextprotocol/server": "^2.4.0",

View File

@@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "0.104.1",
"version": "0.106.0",
"description": "An ACP-compatible coding agent powered by the Claude Agent SDK (TypeScript)",
"main": "dist/lib.js",
"types": "dist/lib.d.ts",
@@ -68,7 +68,7 @@
"node": ">=22"
},
"dependencies": {
"@agentclientprotocol/sdk": "2.5.0",
"@agentclientprotocol/sdk": "2.6.0",
"@anthropic-ai/claude-agent-sdk": "0.3.322",
"diff": "9.0.0",
"zod": "4.6.7"

View File

@@ -74,9 +74,24 @@ try {
process.exit(1);
}
// By default a compiled executable loads `.env`, `.env.local` and `bunfig.toml`
// from its working directory at startup. That directory is the user's project:
// its dotenv values would reach Claude and every Bash command as real
// environment variables (overriding the project's own `.env.test`), and a
// `bunfig.toml` that fails to parse would stop the agent from starting.
const bun = spawnSync(
"bun",
["build", "src/binary-entry.ts", "--compile", "--target", target, "--outfile", outfile],
[
"build",
"src/binary-entry.ts",
"--compile",
"--no-compile-autoload-dotenv",
"--no-compile-autoload-bunfig",
"--target",
target,
"--outfile",
outfile,
],
{ cwd: repoRoot, stdio: "inherit", shell: process.platform === "win32" },
);
if (bun.error) {

View File

@@ -58,8 +58,9 @@ function check(ok, label, detail) {
// ---------------------------------------------------------------- basic
function runSync(args, [cmd, ...cmdArgs] = [command, ...commandArgs]) {
function runSync(args, [cmd, ...cmdArgs] = [command, ...commandArgs], cwd) {
const result = spawnSync(cmd, [...cmdArgs, ...args], {
cwd,
encoding: "utf8",
timeout: 60_000,
});
@@ -101,6 +102,26 @@ if (positionals.length === 0) {
"without claude next to it, says the CLI is missing",
missing.stdout || missing.error,
);
// Started in a project directory, the executable must not read the
// project's dotenv files or bunfig.toml. Node stands in for `claude`, to
// print the environment the CLI is spawned with.
copyFileSync(process.execPath, join(scratch, `claude${exe}`));
const project = join(scratch, "project");
mkdirSync(project);
writeFileSync(join(project, ".env"), "ACP_SMOKE_DOTENV=leaked\n");
writeFileSync(join(project, ".env.local"), "ACP_SMOKE_DOTENV_LOCAL=leaked\n");
writeFileSync(join(project, "bunfig.toml"), "= not toml\n");
const probe = runSync(
["--cli", "-p", "[process.env.ACP_SMOKE_DOTENV, process.env.ACP_SMOKE_DOTENV_LOCAL].join()"],
[alone],
project,
);
check(
probe.stdout === ",",
"ignores .env, .env.local and bunfig.toml in the working directory",
probe.stdout || probe.error,
);
} finally {
rmSync(scratch, { recursive: true, force: true });
}

View File

@@ -104,10 +104,10 @@ export type AcpAuthStatus = Pick<AuthStatusResponse, "state" | "accounts">;
* - No identity read yet (`undefined`): `unknown`, no accounts.
* - `kind: "none"`: `unauthenticated`, no accounts.
* - Any other kind: `authenticated`, with the identity as the one account,
* marked `active`. The account has no field for `detail`, so its label
* carries it in parentheses, e.g. "Anthropic API key (ANTHROPIC_API_KEY)",
* for clients that show only the standard fields. `_meta.claudeCode`
* carries the `kind`, `detail` and `plan` on their own.
* marked `active`. `detail` is the account's `description`, e.g. label
* "Anthropic API key" with description "ANTHROPIC_API_KEY".
* `_meta.claudeCode` carries the `kind` and `plan`, and the `detail` again
* for clients that read it there.
*
* `--hide-claude-auth` does not change the payload: it reports the login the
* CLI holds, also when the subscription guard refuses to use it.
@@ -119,8 +119,8 @@ export function toAcpAuthStatus(status: AuthStatus | undefined): AcpAuthStatus {
if (status.kind === "none") {
return { state: "unauthenticated" };
}
const label = status.detail ? `${status.label} (${status.detail})` : status.label;
const account: AuthAccount = { label, active: true };
const account: AuthAccount = { label: status.label, active: true };
if (status.detail) account.description = status.detail;
if (status.account?.email) account.email = status.account.email;
if (status.account?.organization) account.organization = status.account.organization;
account._meta = {

View File

@@ -6,11 +6,10 @@ import {
import {
forkSession as forkClaudeSession,
getSessionMessages,
importSessionToStore,
type SessionStore,
type SessionStoreEntry,
} from "@anthropic-ai/claude-agent-sdk";
import { createHash } from "node:crypto";
import { loadFullSessionHistory } from "./resumed-session.js";
import { assistantMessageText } from "./session-failure-extension.js";
import { SessionTiming } from "./session-timing.js";
@@ -69,19 +68,6 @@ function forkPointMessageIdCandidates(messageId: string): string[] {
return protocolMessageId === messageId ? [messageId] : [messageId, protocolMessageId];
}
async function loadFullSessionHistory(sessionId: string): Promise<SessionStoreEntry[]> {
// getSessionMessages returns only the active parentUuid chain. The import keeps inactive branches that AIR can still reference.
const entries: SessionStoreEntry[] = [];
const store: SessionStore = {
append: async (_key, batch) => {
entries.push(...batch);
},
load: async () => null,
};
await importSessionToStore(sessionId, store, { includeSubagents: false });
return entries;
}
function assistantGroups(
entries: SessionStoreEntry[],
messageIdForGrouping: ForkSessionDependencies["messageIdForGrouping"],
@@ -235,6 +221,7 @@ async function forkTranscript(
.find((message) => dependencies.messageIdForGrouping(message) === candidateId)?.uuid,
)
.find(Boolean);
// getSessionMessages returns only the active parentUuid chain. The full history keeps inactive branches that AIR can still reference.
const fullHistoryUuid = messageUuid
? undefined
: resolveFromFullHistory(

View File

@@ -5,7 +5,8 @@ export type IdleCompactionHost = {
isBusy(): boolean;
/** Context size after the last main-thread request, or undefined if unknown. */
contextTokens(): number | undefined;
/** Current merged Claude Code settings. */
/** Current Claude Code settings, the client's `settings` option included
* (`SettingsManager.getCompactionSettings`). */
settings(): {
idleCompaction?: boolean;
autoCompactEnabled?: boolean;

View File

@@ -0,0 +1,63 @@
/**
* The unstable "Session options" RFD, as both cores serve it: `session/options`
* answers with what a session would start with, and a setup request's
* `configOptions` set the initial values of the session's config options.
*/
import { RequestError } from "@agentclientprotocol/sdk/unstable";
import type { Logger } from "./logger.js";
/**
* What a core advertises as `options` in its session capabilities:
* `session/options`, and `configOptions` on its setup requests.
*/
export const SESSION_OPTIONS_CAPABILITY = {};
const INVALID_PARAMS = RequestError.invalidParams().code;
/**
* The entries of a setup request's `configOptions`. Omitted and `null` are no
* entries. Two entries with the same `configId` fail with `-32602`. Call it
* before the session starts, so a refused request starts none.
*/
export function initialConfigOptions<E extends { configId: string }>(
entries: readonly E[] | null | undefined,
): readonly E[] {
const seen = new Set<string>();
for (const { configId } of entries ?? []) {
if (seen.has(configId)) {
throw RequestError.invalidParams(
{ configId },
`\`configOptions\` sets ${configId} more than once. Send one entry for each config option.`,
);
}
seen.add(configId);
}
return entries ?? [];
}
/**
* Sets each entry with `set`, in list order. `set` checks an entry against the
* options as the entries before it left them, so a model entry decides which
* effort levels a later entry can pick.
*
* An entry that `set` refuses is skipped, and the entries after it still
* apply. The option keeps its value, which the setup response reports:
*
* - `-32602`: an unknown `configId`, a value of another type than the
* option's, or a value that the option does not offer.
* - Any other failure, such as a model that Claude Code refuses. It is logged.
*/
export async function applyInitialConfigOptions<E extends { configId: string }>(
entries: readonly E[],
set: (entry: E) => Promise<unknown>,
logger: Logger,
): Promise<void> {
for (const entry of entries) {
try {
await set(entry);
} catch (error) {
if (error instanceof RequestError && error.code === INVALID_PARAMS) continue;
logger.error(`Could not set the initial value of config option ${entry.configId}:`, error);
}
}
}

View File

@@ -1,6 +1,13 @@
import { getSessionMessages, type SessionMessage } from "@anthropic-ai/claude-agent-sdk";
import {
getSessionMessages,
importSessionToStore,
type SessionMessage,
type SessionStore,
type SessionStoreEntry,
} from "@anthropic-ai/claude-agent-sdk";
import { access, open, readdir } from "node:fs/promises";
import path from "node:path";
import { isCompactSummaryMessage } from "./context-compaction.js";
import { claudeConfigDir } from "./paths.js";
import { SessionTiming } from "./session-timing.js";
@@ -68,6 +75,97 @@ export async function readResumedSession(
}
}
/**
* Read the messages of a session from its first prompt on, given the
* `getSessionMessages` chain of the session.
*
* `getSessionMessages` follows `parentUuid` links. Claude Code writes each
* `compact_boundary` with `parentUuid: null`, so after a compaction the chain
* starts at its summary. The boundary keeps the last message before it in
* `logicalParentUuid`. For a chain that starts at a summary, this links each
* boundary to that message and reads the transcript through
* `getSessionMessages` again. For a session compacted twice, the result has
* both summaries and the messages before, between and after them. The result
* ends at the last message of `messages`. Any other chain is returned as it
* is, and so is the chain when the read fails or when its result does not
* reach that last message (e.g. the transcript changed between the reads).
*
* `dir` is the project directory of the first read: both reads then resolve
* the same transcript file. Without it, all project directories are searched.
*
* The preserved-message metadata of each boundary is dropped. With it,
* `getSessionMessages` moves the messages that a compaction kept to after the
* summary, and the relinked boundary then leads from them back to the summary:
* the chain loops and ends there. Without it, the kept messages stay where
* they were said, before the boundary.
*/
export async function readHistoryAcrossCompactions(
sessionId: string,
messages: SessionMessage[],
logger?: ResumeLogger,
dir?: string,
): Promise<SessionMessage[]> {
if (!isCompactSummaryMessage(messages[0])) return messages;
try {
const entries = (await loadFullSessionHistory(sessionId, dir)).map(linkCompactBoundary);
const history = await getSessionMessages(sessionId, {
dir,
sessionStore: { append: async () => {}, load: async () => entries },
});
const leaf = messages.at(-1)?.uuid;
const end = history.findIndex((message) => message.uuid === leaf);
if (end < 0) {
logger?.error(
`The history before the last compaction of session ${sessionId} does not reach message ${leaf}: replaying the messages after it`,
);
return messages;
}
return history.slice(0, end + 1);
} catch (error) {
logger?.error(
`Failed to read the history before the last compaction of session ${sessionId}:`,
error,
);
return messages;
}
}
/** Every record of a session's transcript, including the inactive branches
* and the history before a compaction that `getSessionMessages` leaves out.
* Without `dir`, all project directories are searched. */
export async function loadFullSessionHistory(
sessionId: string,
dir?: string,
): Promise<SessionStoreEntry[]> {
const entries: SessionStoreEntry[] = [];
const store: SessionStore = {
append: async (_key, batch) => {
entries.push(...batch);
},
load: async () => null,
};
await importSessionToStore(sessionId, store, { dir, includeSubagents: false });
return entries;
}
/** The record unchanged, or a compaction boundary linked to the message before it. */
function linkCompactBoundary(entry: SessionStoreEntry): SessionStoreEntry {
if (
entry.type !== "system" ||
entry.subtype !== "compact_boundary" ||
typeof entry.logicalParentUuid !== "string"
) {
return entry;
}
const compactMetadata: Record<string, unknown> =
typeof entry.compactMetadata === "object" && entry.compactMetadata !== null
? { ...entry.compactMetadata }
: {};
delete compactMetadata.preservedSegment;
delete compactMetadata.preservedMessages;
return { ...entry, parentUuid: entry.logicalParentUuid, compactMetadata };
}
/** What a resume restores from the end of the local transcript. */
export type ResumedTail = {
model?: string;

View File

@@ -285,7 +285,16 @@ export class SessionModeManager<S extends SessionMode> {
return true;
}
async selectMode(sessionId: string, modeId: string): Promise<PermissionMode> {
/**
* Sets the mode on the query. `auto` on a model without Auto runs as its
* fallback, with the warning. With `deferWarning`, the warning waits for
* the next prompt (see {@link deferFallbackWarning}).
*/
async selectMode(
sessionId: string,
modeId: string,
deferWarning = false,
): Promise<PermissionMode> {
const session = this.requireOpenSession(sessionId);
const requestedMode = this.parseMode(modeId);
if (!this.isAvailable(session.modes.availableModes, requestedMode)) {
@@ -308,7 +317,8 @@ export class SessionModeManager<S extends SessionMode> {
}
if (effectiveMode !== requestedMode) {
await this.publishFallbackWarning(sessionId, session);
if (deferWarning) this.deferFallbackWarning(session);
else await this.publishFallbackWarning(sessionId, session);
}
return effectiveMode;
}
@@ -352,6 +362,16 @@ export class SessionModeManager<S extends SessionMode> {
}
}
/**
* Leaves the Auto fallback's warning for the next prompt
* (`autoModeFallbackWarningPending`), as a session's start does. For a
* fallback during session setup: the client cannot place an update of a
* session before the setup response names it.
*/
deferFallbackWarning(session: SessionMode): void {
if (!session.autoModeFallbackWarningShown) session.autoModeFallbackWarningPending = true;
}
async publishFallbackState(sessionId: string, session: SessionMode): Promise<void> {
await this.publishCurrent(sessionId, AUTO_MODE_FALLBACK);
await this.publishFallbackWarning(sessionId, session);

View File

@@ -39,6 +39,13 @@ export interface SettingsManagerOptions {
type ModelSelectionSettings = Pick<Settings, "availableModels" | "modelOverrides">;
/** The settings that decide whether Claude Code compacts (see `idle-compaction.ts`). */
export type CompactionSettings = {
idleCompaction?: boolean;
autoCompactEnabled?: boolean;
env?: Record<string, string>;
};
/**
* Manages Claude Code settings using the SDK's `resolveSettings` merge engine
* so the values we see match what `query()` would observe.
@@ -54,6 +61,7 @@ export class SettingsManager {
private managedDeniedModels: string[] = [];
private managedModelSettings: ModelSelectionSettings = {};
private managedApiKeyHelper?: string;
private managedCompactionSettings: CompactionSettings = {};
private watchers: fs.FSWatcher[] = [];
private onChange?: () => void;
private logger: { log: (...args: any[]) => void; error: (...args: any[]) => void };
@@ -128,12 +136,23 @@ export class SettingsManager {
resolved.provenance.apiKeyHelper?.source === "managed"
? resolved.effective.apiKeyHelper
: undefined;
const managed = resolved.sources
.filter((entry) => entry.source === "managed")
.map((entry) => entry.settings);
this.managedCompactionSettings = {
idleCompaction: managed.findLast((tier) => tier.idleCompaction !== undefined)
?.idleCompaction,
autoCompactEnabled: managed.findLast((tier) => tier.autoCompactEnabled !== undefined)
?.autoCompactEnabled,
env: Object.assign({}, ...managed.map((tier) => tier.env)),
};
} catch (error) {
this.logger.error("Failed to resolve settings:", error);
this.effective = {};
this.managedDeniedModels = [];
this.managedModelSettings = {};
this.managedApiKeyHelper = undefined;
this.managedCompactionSettings = {};
}
}
@@ -226,6 +245,31 @@ export class SettingsManager {
};
}
/**
* `idleCompaction`, `autoCompactEnabled` and `env` as the CLI resolves them:
* managed settings outrank the `--settings` override, which outranks the
* user/project/local files. `env` merges entry by entry in the same order. A
* key whose value is `undefined` in the override does not hide the files' value.
*/
getCompactionSettings(settingsOverride?: Settings): CompactionSettings {
const managed = this.managedCompactionSettings;
const env: Record<string, string> = {};
for (const tier of [this.effective.env, settingsOverride?.env, managed.env]) {
for (const [name, value] of Object.entries(tier ?? {})) {
if (value !== undefined) env[name] = value;
}
}
return {
idleCompaction:
managed.idleCompaction ?? settingsOverride?.idleCompaction ?? this.effective.idleCompaction,
autoCompactEnabled:
managed.autoCompactEnabled ??
settingsOverride?.autoCompactEnabled ??
this.effective.autoCompactEnabled,
env,
};
}
/**
* `deniedModels` entries from the managed tier, the only tier the CLI
* honors them from.

View File

@@ -1,4 +1,4 @@
{"kind":"initialize","payload":{"_meta":{"jetbrains":{"air":{"capabilities":["sessionFailure","agentFileChangeReport","nativeSubagentSessions","asyncTasks","customInstructions","recommendedValue","diffPatch","planFile","backgroundSubagents"],"goal":{"actions":["set","clear"],"controlMethod":"_session/goal","version":1},"version":1}},"steering":{"supported":true}},"agentCapabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"logout":{},"status":{}},"loadSession":true,"mcpCapabilities":{"http":true,"sse":true},"promptCapabilities":{"embeddedContext":true,"image":true},"providers":{},"sessionCapabilities":{"additionalDirectories":{},"close":{},"delete":{},"fork":{},"list":{},"resume":{},"status":{},"subagents":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"agentInfo":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"authMethods":[],"protocolVersion":1}}
{"kind":"initialize","payload":{"_meta":{"jetbrains":{"air":{"capabilities":["sessionFailure","agentFileChangeReport","nativeSubagentSessions","asyncTasks","customInstructions","recommendedValue","diffPatch","planFile","backgroundSubagents"],"goal":{"actions":["set","clear"],"controlMethod":"_session/goal","version":1},"version":1}},"steering":{"supported":true}},"agentCapabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"logout":{},"status":{}},"loadSession":true,"mcpCapabilities":{"http":true,"sse":true},"promptCapabilities":{"embeddedContext":true,"image":true},"providers":{},"sessionCapabilities":{"additionalDirectories":{},"close":{},"delete":{},"fork":{},"list":{},"options":{},"resume":{},"status":{},"subagents":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"agentInfo":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"authMethods":[],"protocolVersion":1}}
{"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"}}}

View File

@@ -1,3 +1,3 @@
{"kind":"initialize","payload":{"_meta":{"jetbrains":{"air":{"capabilities":["sessionFailure","agentFileChangeReport","nativeSubagentSessions","asyncTasks","customInstructions","recommendedValue","diffPatch","planFile","backgroundSubagents"],"goal":{"actions":["set","clear"],"controlMethod":"_session/goal","version":1},"version":1}},"steering":{"supported":true}},"agentCapabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"logout":{},"status":{}},"loadSession":true,"mcpCapabilities":{"http":true,"sse":true},"promptCapabilities":{"embeddedContext":true,"image":true},"providers":{},"sessionCapabilities":{"additionalDirectories":{},"close":{},"delete":{},"fork":{},"list":{},"resume":{},"status":{},"subagents":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"agentInfo":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"authMethods":[],"protocolVersion":1}}
{"kind":"initialize","payload":{"_meta":{"jetbrains":{"air":{"capabilities":["sessionFailure","agentFileChangeReport","nativeSubagentSessions","asyncTasks","customInstructions","recommendedValue","diffPatch","planFile","backgroundSubagents"],"goal":{"actions":["set","clear"],"controlMethod":"_session/goal","version":1},"version":1}},"steering":{"supported":true}},"agentCapabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"logout":{},"status":{}},"loadSession":true,"mcpCapabilities":{"http":true,"sse":true},"promptCapabilities":{"embeddedContext":true,"image":true},"providers":{},"sessionCapabilities":{"additionalDirectories":{},"close":{},"delete":{},"fork":{},"list":{},"options":{},"resume":{},"status":{},"subagents":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"agentInfo":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"authMethods":[],"protocolVersion":1}}
{"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"}}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"/goal Ship the feature","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[],"messageId":"00000000-0000-4000-8000-00000000c001","sessionUpdate":"user_message"}}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":{"text":"Fix the bug","type":"text"},"messageId":"00000000-0000-4000-8000-00000000c001","sessionUpdate":"user_message_chunk"}}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[],"messageId":"msg_r1","sessionUpdate":"agent_thought"}}}

View File

@@ -1,2 +1,2 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -1,4 +1,4 @@
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}

View File

@@ -34,6 +34,10 @@
* - The `initialize` response also advertises
* `agentCapabilities.sessionCapabilities.title`, which origin/main did not:
* the agent now serves `session/set_title`.
* - The `initialize` response also advertises
* `agentCapabilities.sessionCapabilities.options`, which origin/main did
* not: the agent now serves `session/options` and takes `configOptions` on
* session setup requests.
* - A SandboxNetworkAccess tool call is settled by a `tool_call_update` with
* only its final `status` once its permission request is answered. The
* callback runs nothing, so origin/main never settled the call (see
@@ -278,7 +282,7 @@ export function compareWithBaseline(baseline: Recorded[], traffic: Recorded[]):
const current = withoutSandboxNetworkSettlements(
traffic.map((record) =>
withoutAuthStatusCapability(
withoutSessionCapabilities(record, ["systemPrompt", "status", "title"]),
withoutSessionCapabilities(record, ["systemPrompt", "status", "title", "options"]),
),
),
);

View File

@@ -9,6 +9,8 @@ import {
type ClientCapabilities,
type InitializeRequest,
} from "@agentclientprotocol/sdk/unstable";
import { mkdir, writeFile } from "node:fs/promises";
import path from "node:path";
/** The context-usage report the base mock query returns. `rawMaxTokens`
* matches the agent's DEFAULT_CONTEXT_WINDOW so window-related assertions
@@ -82,3 +84,73 @@ export function heldRequest<T>(_params?: unknown, signal?: AbortSignal): Promise
else signal?.addEventListener("abort", cancel, { once: true });
});
}
/** A transcript record of a user message. */
export function transcriptUser(uuid: string, content: string, extra: object = {}) {
return { type: "user", uuid, message: { role: "user", content }, ...extra };
}
/** A transcript record of an assistant text response. */
export function transcriptAssistant(uuid: string, text: string) {
return {
type: "assistant",
uuid,
message: {
id: `msg_${uuid}`,
role: "assistant",
model: "claude-opus-5",
content: [{ type: "text", text }],
},
};
}
/** A `compact_boundary` as Claude Code writes it: no parent, and the last
* message before it in `logicalParentUuid`. */
export function transcriptCompactBoundary(
uuid: string,
logicalParentUuid: string,
compactMetadata: object = {},
) {
return {
type: "system",
subtype: "compact_boundary",
uuid,
parentUuid: null,
logicalParentUuid,
compactMetadata: { trigger: "manual", preTokens: 1000, ...compactMetadata },
};
}
/** The summary message that follows a `compact_boundary`. */
export function transcriptCompactSummary(
uuid: string,
content = "This session is being continued from a previous conversation that ran out of context. The summary below covers the earlier portion of the conversation.\n\n" +
"Summary:\n1. Primary Request and Intent:\n Say hi.\n\n" +
"Continue the conversation from where it left off without asking the user any further questions. Resume directly — do not acknowledge the summary.",
) {
return transcriptUser(uuid, content, { isCompactSummary: true });
}
/** Writes `<directory>/<sessionId>.jsonl` as Claude Code does: each record
* links to the record before it, except a record that sets its own
* `parentUuid`. */
export async function writeTranscript(
directory: string,
sessionId: string,
records: Record<string, unknown>[],
): Promise<void> {
await mkdir(directory, { recursive: true });
let parentUuid: unknown = null;
const lines = records.map((record) => {
const line = {
parentUuid,
sessionId,
isSidechain: false,
timestamp: "2026-10-11T00:00:00.000Z",
...record,
};
parentUuid = record.uuid;
return JSON.stringify(line);
});
await writeFile(path.join(directory, `${sessionId}.jsonl`), lines.join("\n") + "\n");
}

View File

@@ -1,9 +1,20 @@
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import type { SessionMessage } from "@anthropic-ai/claude-agent-sdk";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { getSessionMessages, type SessionMessage } from "@anthropic-ai/claude-agent-sdk";
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
import {
transcriptAssistant,
transcriptCompactBoundary,
transcriptCompactSummary,
transcriptUser,
writeTranscript,
} from "./helpers.js";
import os from "node:os";
import path from "node:path";
import { readResumedTail, resumedModelFromTranscript } from "../resumed-session.js";
import {
readHistoryAcrossCompactions,
readResumedTail,
resumedModelFromTranscript,
} from "../resumed-session.js";
function assistant(
model: unknown,
@@ -203,3 +214,187 @@ describe("readResumedTail", () => {
expect(await readResumedTail("no-mode")).toEqual({ model: "claude-opus-5" });
});
});
describe("readHistoryAcrossCompactions", () => {
const sessionId = "33333333-3333-4333-8333-333333333333";
let configDir: string;
let originalConfigDir: string | undefined;
beforeEach(async () => {
configDir = await mkdtemp(path.join(os.tmpdir(), "claude-acp-compacted-"));
originalConfigDir = process.env.CLAUDE_CONFIG_DIR;
process.env.CLAUDE_CONFIG_DIR = configDir;
});
afterEach(async () => {
if (originalConfigDir === undefined) delete process.env.CLAUDE_CONFIG_DIR;
else process.env.CLAUDE_CONFIG_DIR = originalConfigDir;
await rm(configDir, { recursive: true, force: true });
});
const transcript = (records: Record<string, unknown>[], project = "-workspace") =>
writeTranscript(path.join(configDir, "projects", project), sessionId, records);
const user = transcriptUser;
const assistant = transcriptAssistant;
const boundary = transcriptCompactBoundary;
const summary = (uuid: string) => transcriptCompactSummary(uuid, `Summary ${uuid}`);
const texts = (messages: SessionMessage[]) =>
messages.map((message) => {
const content = (message.message as { content: unknown }).content;
return typeof content === "string" ? content : (content as { text: string }[])[0]!.text;
});
it("reads the messages before each compaction", async () => {
await transcript([
user("u1", "hi"),
assistant("a1", "Hello"),
boundary("b1", "a1"),
summary("s1"),
user("u2", "next"),
assistant("a2", "Next"),
boundary("b2", "a2"),
summary("s2"),
user("u3", "identify yourself"),
assistant("a3", "Claude"),
]);
// getSessionMessages stops at the last boundary.
const chain = await getSessionMessages(sessionId);
expect(texts(chain)).toEqual(["Summary s2", "identify yourself", "Claude"]);
expect(texts(await readHistoryAcrossCompactions(sessionId, chain))).toEqual([
"hi",
"Hello",
"Summary s1",
"next",
"Next",
"Summary s2",
"identify yourself",
"Claude",
]);
});
it("keeps the messages that a compaction preserved where they were said", async () => {
// Claude Code 2.1.293 keeps u2 and a2 in the context after the summary,
// and records them in both forms of preserved-message metadata.
await transcript([
user("u1", "hi"),
assistant("a1", "Hello"),
user("u2", "keep this"),
assistant("a2", "Kept"),
boundary("b1", "a2", {
preservedSegment: { headUuid: "u2", anchorUuid: "s1", tailUuid: "a2" },
preservedMessages: { anchorUuid: "s1", uuids: ["u2", "a2"] },
}),
summary("s1"),
user("u3", "after"),
assistant("a3", "After"),
]);
// getSessionMessages moves the preserved messages after the summary.
const chain = await getSessionMessages(sessionId);
expect(texts(chain)).toEqual(["Summary s1", "keep this", "Kept", "after", "After"]);
expect(texts(await readHistoryAcrossCompactions(sessionId, chain))).toEqual([
"hi",
"Hello",
"keep this",
"Kept",
"Summary s1",
"after",
"After",
]);
});
it("returns the chain of a session without a compaction as it is", async () => {
await transcript([user("u1", "hi"), assistant("a1", "Hello")]);
const chain = await getSessionMessages(sessionId);
expect(await readHistoryAcrossCompactions(sessionId, chain)).toBe(chain);
});
it("ends at the last message of the chain it was given", async () => {
await transcript([
user("u1", "hi"),
assistant("a1", "Hello"),
boundary("b1", "a1"),
summary("s1"),
user("u2", "identify yourself"),
]);
const chain = await getSessionMessages(sessionId);
// Claude Code appends a response after the first read.
await transcript([
user("u1", "hi"),
assistant("a1", "Hello"),
boundary("b1", "a1"),
summary("s1"),
user("u2", "identify yourself"),
assistant("a2", "Claude"),
]);
expect(texts(await readHistoryAcrossCompactions(sessionId, chain))).toEqual([
"hi",
"Hello",
"Summary s1",
"identify yourself",
]);
});
it.each([
["the transcript is gone", async () => rm(configDir, { recursive: true, force: true })],
[
"the transcript no longer has the last message",
() =>
transcript([
user("u1", "hi"),
assistant("a1", "Hello"),
boundary("b1", "a1"),
summary("s1"),
user("u9", "other"),
]),
],
])("returns the chain and logs when %s", async (_case, change) => {
await transcript([
user("u1", "hi"),
assistant("a1", "Hello"),
boundary("b1", "a1"),
summary("s1"),
user("u2", "identify yourself"),
]);
const chain = await getSessionMessages(sessionId);
await change();
const error = vi.fn();
expect(await readHistoryAcrossCompactions(sessionId, chain, { log: () => {}, error })).toBe(
chain,
);
expect(error).toHaveBeenCalledOnce();
});
it("reads the transcript in the project directory it is given", async () => {
await transcript(
[
user("u1", "elsewhere"),
assistant("a1", "Elsewhere"),
boundary("b1", "a1"),
summary("s1"),
user("u2", "identify yourself"),
],
"-a-other",
);
await transcript(
[
user("u1", "hi"),
assistant("a1", "Hello"),
boundary("b1", "a1"),
summary("s1"),
user("u2", "identify yourself"),
],
"-z-workspace",
);
const chain = await getSessionMessages(sessionId, { dir: "/z/workspace" });
expect(
texts(await readHistoryAcrossCompactions(sessionId, chain, undefined, "/z/workspace")),
).toEqual(["hi", "Hello", "Summary s1", "identify yourself"]);
});
});

View File

@@ -38,3 +38,62 @@ describe("SettingsManager.getApiKeyHelper", () => {
manager.dispose();
});
});
describe("SettingsManager.getCompactionSettings", () => {
it("ranks managed settings over the --settings override over the files, env entry by entry", async () => {
const manager = await managerResolving({
effective: {
idleCompaction: true,
autoCompactEnabled: false,
env: {
DISABLE_COMPACT: "1",
DISABLE_AUTO_COMPACT: "1",
CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS: "1",
},
},
provenance: {},
sources: [
{ source: "userSettings", settings: { autoCompactEnabled: false } },
{
source: "managed",
settings: { idleCompaction: true, env: { DISABLE_AUTO_COMPACT: "1" } },
},
],
});
expect(
manager.getCompactionSettings({
idleCompaction: false,
autoCompactEnabled: true,
env: { DISABLE_COMPACT: "0", DISABLE_AUTO_COMPACT: "0" },
}),
).toEqual({
idleCompaction: true,
autoCompactEnabled: true,
env: {
DISABLE_COMPACT: "0",
DISABLE_AUTO_COMPACT: "1",
CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS: "1",
},
});
manager.dispose();
});
it("keeps the files' value for a key the override sets to undefined", async () => {
const manager = await managerResolving({
effective: { idleCompaction: false, env: { DISABLE_COMPACT: "1" } },
provenance: {},
sources: [],
});
expect(
manager.getCompactionSettings({
idleCompaction: undefined,
env: { DISABLE_COMPACT: undefined as unknown as string },
}),
).toEqual({
idleCompaction: false,
autoCompactEnabled: undefined,
env: { DISABLE_COMPACT: "1" },
});
manager.dispose();
});
});

View File

@@ -58,7 +58,16 @@ import {
parseUsageResponse,
} from "../../usage-markdown.js";
import { Pushable } from "../../utils.js";
import { heldRequest, initializeClient, makeMockQuery } from "../helpers.js";
import {
heldRequest,
initializeClient,
makeMockQuery,
transcriptAssistant,
transcriptCompactBoundary,
transcriptCompactSummary,
transcriptUser,
writeTranscript,
} from "../helpers.js";
import { acpProtocolRouter } from "../../serve.js";
import * as agentSdk from "@anthropic-ai/claude-agent-sdk";
import {
@@ -3629,6 +3638,63 @@ describe("usage-limit failure replay", () => {
});
});
describe("compacted session replay", () => {
it("replays the messages before the compaction, then the compaction", async () => {
const configDir = await mkdtemp(path.join(os.tmpdir(), "claude-acp-compacted-replay-"));
const originalConfigDir = process.env.CLAUDE_CONFIG_DIR;
process.env.CLAUDE_CONFIG_DIR = configDir;
try {
const sessionId = "44444444-4444-4444-8444-444444444444";
// The records of `/compact` between two prompts, as Claude Code writes
// them: the boundary has no parent and links "Hello" logically.
await writeTranscript(path.join(configDir, "projects", "-tmp-proj"), sessionId, [
transcriptUser("u1", "hi"),
transcriptAssistant("a1", "Hello"),
transcriptCompactBoundary("b1", "a1"),
transcriptCompactSummary("s1"),
transcriptUser("u2", "identify yourself"),
transcriptAssistant("a2", "Claude"),
]);
const updates: SessionNotification[] = [];
const client = {
sessionUpdate: async (update: SessionNotification) => {
updates.push(update);
},
} as unknown as AcpClient;
const agent = new ClaudeAcpAgent(client, { log: () => {}, error: () => {} });
await initializeClient(agent, { session: { compaction: {} } } as ClientCapabilities);
await (
agent as unknown as { replaySessionHistory(sessionId: string): Promise<void> }
).replaySessionHistory(sessionId);
expect(
updates.flatMap(({ update }) => {
if (update.sessionUpdate === "compaction_update") return [["compaction", update.status]];
if (
(update.sessionUpdate === "user_message_chunk" ||
update.sessionUpdate === "agent_message_chunk") &&
update.content.type === "text"
) {
return [[update.sessionUpdate, update.content.text]];
}
return [];
}),
).toEqual([
["user_message_chunk", "hi"],
["agent_message_chunk", "Hello"],
["compaction", "completed"],
["user_message_chunk", "identify yourself"],
["agent_message_chunk", "Claude"],
]);
} finally {
if (originalConfigDir === undefined) delete process.env.CLAUDE_CONFIG_DIR;
else process.env.CLAUDE_CONFIG_DIR = originalConfigDir;
await rm(configDir, { recursive: true, force: true });
}
});
});
describe("session/list", () => {
const sdkSession = (index: number) => ({
sessionId: `session-${index}`,

View File

@@ -220,7 +220,8 @@ describe("auth status mappers", () => {
state: "authenticated",
accounts: [
{
label: "Anthropic API key (env)",
label: "Anthropic API key",
description: "env",
active: true,
_meta: { claudeCode: { kind: "api_key", detail: "env" } },
},
@@ -842,7 +843,8 @@ describe("auth status over ACP", () => {
state: "authenticated",
accounts: [
{
label: "Custom model gateway (gw.example.com)",
label: "Custom model gateway",
description: "gw.example.com",
active: true,
_meta: { claudeCode: { kind: "gateway", detail: "gw.example.com" } },
},
@@ -860,7 +862,7 @@ describe("auth status over ACP", () => {
agent.setAuthStatus({ kind: "api_key", label: "Anthropic API key", detail: "env" });
expect(await agent.authStatusResponse()).toMatchObject({
state: "authenticated",
accounts: [{ label: "Anthropic API key (env)" }],
accounts: [{ label: "Anthropic API key", description: "env" }],
});
});

View File

@@ -1365,6 +1365,229 @@ describe("createSession options merging", () => {
});
});
describe("session options", () => {
const cwd = process.cwd();
const TWO_MODELS = [
{
value: "claude-sonnet-4-6",
displayName: "Claude Sonnet",
description: "Fast",
supportsAutoMode: true,
supportsEffort: true,
supportedEffortLevels: ["low", "medium", "high"],
},
{
value: "claude-haiku-4-5",
displayName: "Claude Haiku",
description: "Faster",
supportsEffort: true,
supportedEffortLevels: ["low", "medium"],
},
];
let updates: SessionNotification[];
const values = (response: { configOptions?: { id: string; currentValue: unknown }[] | null }) =>
Object.fromEntries((response.configOptions ?? []).map((o) => [o.id, o.currentValue]));
beforeEach(() => {
initModels = TWO_MODELS;
updates = [];
vi.spyOn(agent.client, "sessionUpdate").mockImplementation(async (notification) => {
updates.push(notification as SessionNotification);
});
});
it("advertises session/options", async () => {
const response = await agent.initialize({ protocolVersion: 1, clientCapabilities: {} });
expect(response.agentCapabilities?.sessionCapabilities?.options).toEqual({});
});
it("answers session/options with what session/new returns, from a query that it closes", async () => {
const options = await agent.sessionOptions({ cwd, additionalDirectories: ["/extra"] });
expect(capturedOptions).toMatchObject({
cwd,
additionalDirectories: ["/extra"],
mcpServers: {},
persistSession: false,
});
expect(capturedOptions!.resume).toBeUndefined();
expect(closeSpy).toHaveBeenCalledTimes(1);
expect(agent.sessions).toEqual({});
expect(updates).toEqual([]);
const { sessionId, ...created } = await agent.newSession({ cwd, mcpServers: [] });
expect(sessionId).toBeDefined();
expect(capturedOptions!.persistSession).toBeUndefined();
expect(options).toEqual(created);
});
it("answers session/options of a held session with its current options, without a query", async () => {
const { sessionId } = await agent.newSession({ cwd, mcpServers: [] });
const { configOptions } = await agent.setSessionConfigOption({
sessionId,
configId: "model",
value: "claude-haiku-4-5",
});
capturedOptions = undefined;
const options = await agent.sessionOptions({ cwd, sessionId });
expect(capturedOptions).toBeUndefined();
expect(options).toEqual({ modes: agent.sessions[sessionId]!.modes, configOptions });
expect(values(options).model).toBe("claude-haiku-4-5");
});
it("answers session/options of a stored session from a query that resumes it", async () => {
const sessionId = "7f1c5b0e-3c53-4c0c-9d0a-0d6c1f0a2b11";
await agent.sessionOptions({ cwd, sessionId });
expect(capturedOptions).toMatchObject({ resume: sessionId, persistSession: false });
expect(capturedOptions!.sessionId).toBeUndefined();
expect(closeSpy).toHaveBeenCalledTimes(1);
expect(agent.sessions).toEqual({});
});
it("fails session/options of an unknown session with -32002", async () => {
const sessionId = "7f1c5b0e-3c53-4c0c-9d0a-0d6c1f0a2b11";
initError = new Error(`No conversation found with session ID: ${sessionId}`);
await expect(agent.sessionOptions({ cwd, sessionId })).rejects.toMatchObject({
code: RequestError.sessionNotFound(sessionId).code,
data: { sessionId },
});
expect(closeSpy).toHaveBeenCalledTimes(1);
});
it("starts a new session with the request's configOptions, in list order, without an update", async () => {
const setModels: string[] = [];
setModelImpl = async (model) => void setModels.push(model);
const response = await agent.newSession({
cwd,
mcpServers: [],
configOptions: [
{ configId: "model", value: "claude-haiku-4-5" },
// Haiku offers no "high": the entry is checked against the options the model left.
{ configId: "effort", value: "high" },
{ configId: "mode", value: "plan" },
],
});
expect(setModels).toEqual(["claude-haiku-4-5"]);
expect(values(response)).toMatchObject({ model: "claude-haiku-4-5", mode: "plan" });
expect(values(response).effort).not.toBe("high");
expect(response.modes?.currentModeId).toBe("plan");
expect(response.configOptions).toEqual(agent.sessions[response.sessionId]!.configOptions);
expect(updates.filter((u) => u.sessionId === response.sessionId)).toEqual([]);
// A restart of the query restores the session's choices, not the request's.
expect(agent.sessions[response.sessionId]!.creationParams).not.toHaveProperty(
"configOptions",
);
});
it.each([
["an unknown configId", { configId: "nope", value: "x" }],
["a boolean for a select", { configId: "model", type: "boolean" as const, value: true }],
["a value the option does not offer", { configId: "model", value: "gpt-4" }],
])("skips an entry with %s and sets the entries after it", async (_name, entry) => {
const plain = await agent.newSession({ cwd, mcpServers: [] });
const response = await agent.newSession({
cwd,
mcpServers: [],
configOptions: [entry, { configId: "mode", value: "plan" }],
});
expect(values(response)).toEqual({ ...values(plain), mode: "plan" });
});
it("skips an entry that Claude Code refuses", async () => {
setModelImpl = async () => {
throw new Error("model refused");
};
const errors = vi.spyOn(console, "error").mockImplementation(() => {});
const response = await agent.newSession({
cwd,
mcpServers: [],
configOptions: [
{ configId: "model", value: "claude-haiku-4-5" },
{ configId: "mode", value: "plan" },
],
});
expect(values(response)).toMatchObject({ model: "claude-sonnet-4-6", mode: "plan" });
expect(errors).toHaveBeenCalledWith(
"Could not set the initial value of config option model:",
expect.any(Error),
);
errors.mockRestore();
});
it.each(["newSession", "loadSession", "resumeSession"] as const)(
"%s rejects two entries of one configId before it starts a query",
async (method) => {
await expect(
agent[method]({
sessionId: "7f1c5b0e-3c53-4c0c-9d0a-0d6c1f0a2b11",
cwd,
mcpServers: [],
configOptions: [
{ configId: "mode", value: "plan" },
{ configId: "mode", value: "default" },
],
}),
).rejects.toMatchObject({
code: RequestError.invalidParams().code,
data: { configId: "mode" },
});
expect(capturedOptions).toBeUndefined();
},
);
it.each(["loadSession", "resumeSession"] as const)(
"%s sets the request's configOptions on the session, a held one too",
async (method) => {
const sessionId = "7f1c5b0e-3c53-4c0c-9d0a-0d6c1f0a2b11";
const started = await agent[method]({
sessionId,
cwd,
mcpServers: [],
configOptions: [{ configId: "mode", value: "plan" }],
});
expect(values(started).mode).toBe("plan");
expect(started.modes?.currentModeId).toBe("plan");
const held = await agent[method]({
sessionId,
cwd,
mcpServers: [],
configOptions: [{ configId: "model", value: "claude-haiku-4-5" }],
});
expect(values(held)).toMatchObject({ mode: "plan", model: "claude-haiku-4-5" });
expect(updates.map((u) => u.update.sessionUpdate)).not.toContain("current_mode_update");
expect(updates.map((u) => u.update.sessionUpdate)).not.toContain("config_option_update");
},
);
it("leaves the warning of an Auto mode fallback for the first prompt", async () => {
const response = await agent.newSession({
cwd,
mcpServers: [],
configOptions: [
{ configId: "mode", value: "auto" },
// Haiku cannot serve Auto.
{ configId: "model", value: "claude-haiku-4-5" },
],
});
expect(values(response)).toMatchObject({ mode: "acceptEdits", model: "claude-haiku-4-5" });
expect(updates.filter((u) => u.sessionId === response.sessionId)).toEqual([]);
expect(agent.sessions[response.sessionId]!.autoModeFallbackWarningPending).toBe(true);
});
});
describe("cwd validation", () => {
it("rejects a relative cwd with invalidParams", async () => {
await expect(

View File

@@ -226,7 +226,10 @@ function scriptClaudeCode({
};
}
async function connect(clientCapabilities: Record<string, unknown> = {}) {
async function connect(
clientCapabilities: Record<string, unknown> = {},
sessionMeta?: Record<string, unknown>,
) {
vi.resetModules();
const { ClaudeAcpAgent } = await import("../../v1/acp-agent.js");
const updates: Array<{ update: Record<string, any> }> = [];
@@ -241,7 +244,7 @@ async function connect(clientCapabilities: Record<string, unknown> = {}) {
error: () => {},
});
await initializeClient(agent, clientCapabilities);
const session = await agent.newSession({ cwd, mcpServers: [] });
const session = await agent.newSession({ cwd, mcpServers: [], _meta: sessionMeta });
return { agent, sessionId: session.sessionId, updates, logs };
}
@@ -322,6 +325,22 @@ describe("idle compaction in the agent", () => {
await agent.dispose();
});
/** The client's `settings` option reaches the CLI as `--settings`, and idle compaction reads it too. */
it("does not compact a session whose client turned idle compaction off in the settings option", async () => {
const claude = scriptClaudeCode();
const { agent, sessionId } = await connect(
{},
{ claudeCode: { options: { settings: { idleCompaction: false } } } },
);
await promptHi(agent, sessionId);
await claude.untilIdle();
await vi.advanceTimersByTimeAsync(2 * 60 * MINUTE_MS);
expect(claude.received).toEqual(["hi"]);
await agent.dispose();
});
/** Closing the session during the wait drops the timer. */
it("does not compact once the session is closed", async () => {
const claude = scriptClaudeCode();

View File

@@ -399,6 +399,7 @@ describe("ACP protocol routing", () => {
additionalDirectories: {},
systemPrompt: { mode: { override: {} } },
status: {},
options: {},
title: {},
});
expect(response.capabilities?.providers).toEqual({});
@@ -4211,47 +4212,60 @@ describe("ACP v2 idle compaction", () => {
},
});
/**
* Prompts "hi" in a session created with `meta`, answers it with a large
* one-hour request, and waits 54 minutes. Returns the prompts Claude Code
* received and the client.
*/
async function promptAndIdle(meta?: Record<string, unknown>) {
const received: string[] = [];
sdk.run = async function* (prompts, options) {
const input = prompts[Symbol.asyncIterator]();
for (;;) {
const { value, done } = await input.next();
if (done) return;
received.push((value.message.content as Array<{ text: string }>)[0].text);
if (received.length === 1) {
yield {
type: "user",
message: value.message,
parent_tool_use_id: null,
uuid: value.uuid,
session_id: options.sessionId,
isReplay: true,
};
yield largeOneHourRequest(options);
} else {
yield { type: "system", subtype: "status", status: "compacting", uuid: randomUUID() };
}
yield result(options);
yield idleState(options);
}
};
const client = v2Client();
await client.app.connectWith(connectRouter(), async (agent) => {
await initializeV2(agent);
const { sessionId } = await agent.request(v2.methods.agent.session.new, {
cwd,
_meta: meta,
});
await agent.request(v2.methods.agent.session.prompt, { sessionId, prompt: text("hi") });
await vi.advanceTimersByTimeAsync(0);
await vi.advanceTimersByTimeAsync(54 * 60_000);
for (let i = 0; i < 20 && received.length < 2; i++) await vi.advanceTimersByTimeAsync(0);
for (let i = 0; i < 20 && turnTrace(client.sessionUpdates).length < 6; i++) {
await vi.advanceTimersByTimeAsync(0);
}
await client.authUpdate(1);
});
return { received, client };
}
/** The session is idle for 54 minutes after a large one-hour request, and the adapter's `/compact` runs. */
it("reports the compaction that the adapter starts as running, then idle, with no user_message", async () => {
vi.useFakeTimers({ toFake: ["setTimeout", "clearTimeout", "Date"] });
try {
const received: string[] = [];
sdk.run = async function* (prompts, options) {
const input = prompts[Symbol.asyncIterator]();
for (;;) {
const { value, done } = await input.next();
if (done) return;
received.push((value.message.content as Array<{ text: string }>)[0].text);
if (received.length === 1) {
yield {
type: "user",
message: value.message,
parent_tool_use_id: null,
uuid: value.uuid,
session_id: options.sessionId,
isReplay: true,
};
yield largeOneHourRequest(options);
} else {
yield { type: "system", subtype: "status", status: "compacting", uuid: randomUUID() };
}
yield result(options);
yield idleState(options);
}
};
const client = v2Client();
await client.app.connectWith(connectRouter(), async (agent) => {
await initializeV2(agent);
const { sessionId } = await agent.request(v2.methods.agent.session.new, { cwd });
await agent.request(v2.methods.agent.session.prompt, { sessionId, prompt: text("hi") });
await vi.advanceTimersByTimeAsync(0);
await vi.advanceTimersByTimeAsync(54 * 60_000);
for (let i = 0; i < 20 && received.length < 2; i++) await vi.advanceTimersByTimeAsync(0);
for (let i = 0; i < 20 && turnTrace(client.sessionUpdates).length < 6; i++) {
await vi.advanceTimersByTimeAsync(0);
}
await client.authUpdate(1);
});
const { received, client } = await promptAndIdle();
expect(received).toEqual(["hi", "/compact"]);
expect(turnTrace(client.sessionUpdates)).toEqual([
@@ -4266,6 +4280,20 @@ describe("ACP v2 idle compaction", () => {
vi.useRealTimers();
}
});
/** The client's `settings` option reaches the CLI as `--settings`, and idle compaction reads it too. */
it("does not compact a session whose client turned idle compaction off in the settings option", async () => {
vi.useFakeTimers({ toFake: ["setTimeout", "clearTimeout", "Date"] });
try {
const { received } = await promptAndIdle({
claudeCode: { options: { settings: { idleCompaction: false } } },
});
expect(received).toEqual(["hi"]);
} finally {
vi.useRealTimers();
}
});
});
// Claude Code runs model cycles that no prompt started, for example its

View File

@@ -24,6 +24,13 @@ import { acpProtocolRouter } from "../../serve.js";
import { SettingsManager } from "../../settings.js";
import type { AgentHandle } from "../../v2/agent.js";
import { StoppedWork } from "../../v2/stopped-work.js";
import {
transcriptAssistant,
transcriptCompactBoundary,
transcriptCompactSummary,
transcriptUser,
writeTranscript,
} from "../helpers.js";
/** One Claude Code process: the prompts it reads and the messages it sends. */
type FakeClaudeCode = {
@@ -489,6 +496,7 @@ describe("ACP v2 core", () => {
expect(response.protocolVersion).toBe(2);
expect(response.capabilities?.session?.fork).toEqual({});
expect(response.capabilities?.session?.options).toEqual({});
expect(response.capabilities?.session?.prompt).toEqual({ image: {}, embeddedContext: {} });
expect((response.authMethods ?? []).map((method) => method.methodId)).toContain(
"console-login",
@@ -1805,6 +1813,234 @@ describe("ACP v2 core", () => {
expect(error).toMatchObject({ code: -32602 });
});
describe("session options", () => {
const STORED = "7f1c5b0e-3c53-4c0c-9d0a-0d6c1f0a2b11";
const values = (options: v2.SessionConfigOption[] | undefined) =>
Object.fromEntries((options ?? []).map((o) => [o.configId, o.currentValue]));
const initialize = (agent: v2.ClientContext) =>
agent.request(v2.methods.agent.initialize, {
protocolVersion: v2.PROTOCOL_VERSION,
info: { name: "v2-test-client", version: "1.0.0" },
capabilities: {},
});
beforeEach(() => {
sdk.models = [
{
value: "default",
displayName: "Default",
description: "Recommended",
supportsAutoMode: true,
supportsEffort: true,
supportedEffortLevels: ["low", "medium", "high"],
},
{
value: "haiku",
displayName: "Haiku",
description: "Fast",
supportsAutoMode: false,
supportsEffort: true,
supportedEffortLevels: ["low", "medium"],
},
];
});
it("answers session/options with what session/new returns, from a query that it closes", async () => {
const client = v2Client();
const { options, created } = await client.connect(async (agent) => {
await initialize(agent);
const options = await agent.request(v2.methods.agent.session.options, {
cwd,
additionalDirectories: ["/extra"],
});
const created = await agent.request(v2.methods.agent.session.new, { cwd });
return { options, created };
});
const [probe, session] = sdk.processes;
expect(probe.options).toMatchObject({
cwd,
additionalDirectories: ["/extra"],
mcpServers: {},
persistSession: false,
});
expect(probe.close).toHaveBeenCalledTimes(1);
expect(session.options.persistSession).toBeUndefined();
const { sessionId, ...fields } = created;
expect(sessionId).not.toBe(probe.options.sessionId);
expect(options).toEqual(fields);
expect(options.availableCommands?.map((command) => command.name)).toContain("review");
expect(client.notifications).toEqual([]);
});
it("answers session/options of an active session with its current options, without a query", async () => {
const client = v2Client();
const { options, configOptions, wrongCwd } = await client.connect(async (agent) => {
const { response } = await openSession(agent);
const { sessionId } = response;
const { configOptions } = await agent.request(v2.methods.agent.session.setConfigOption, {
sessionId,
configId: "model",
type: "id",
value: "haiku",
});
const options = await agent.request(v2.methods.agent.session.options, { cwd, sessionId });
const wrongCwd = await agent
.request(v2.methods.agent.session.options, { cwd: tempDir, sessionId })
.catch((error: unknown) => error);
return { options, configOptions, wrongCwd };
});
expect(sdk.processes).toHaveLength(1);
expect(options.configOptions).toEqual(configOptions);
expect(values(options.configOptions).model).toBe("haiku");
expect(wrongCwd).toMatchObject({ code: -32602 });
});
it("answers session/options of a stored session from a query that resumes it", async () => {
const client = v2Client();
const status = await client.connect(async (agent) => {
await initialize(agent);
await agent.request(v2.methods.agent.session.options, { cwd, sessionId: STORED });
return agent
.request(v2.methods.agent.session.status, { sessionId: STORED })
.catch((error: unknown) => error);
});
const [probe] = sdk.processes;
expect(probe.options).toMatchObject({ resume: STORED, persistSession: false });
expect(probe.options.sessionId).toBeUndefined();
expect(probe.close).toHaveBeenCalledTimes(1);
// The session is not active: it has no transcript in this test.
expect(status).toMatchObject({ code: -32002 });
});
it("fails session/options of an unknown session with -32002", async () => {
sdk.startFailure = new Error(`No conversation found with session ID: ${STORED}`);
const client = v2Client();
const error = await client.connect(async (agent) => {
await initialize(agent);
return agent
.request(v2.methods.agent.session.options, { cwd, sessionId: STORED })
.catch((error: unknown) => error);
});
expect(error).toMatchObject({ code: -32002, data: { sessionId: STORED } });
expect(sdk.processes[0].close).toHaveBeenCalled();
});
it("starts a new session with the request's configOptions, in list order, without an update", async () => {
const client = v2Client();
const response = await client.connect(async (agent) => {
await initialize(agent);
return agent.request(v2.methods.agent.session.new, {
cwd,
configOptions: [
// Skipped: an unknown option, a boolean for a select, and a value not offered.
{ configId: "nope", type: "id", value: "x" },
{ configId: "ultracode", type: "boolean", value: true },
{ configId: "model", type: "id", value: "haiku" },
// Haiku offers no "high": the entry is checked against the options the model left.
{ configId: "effort", type: "id", value: "high" },
{ configId: "mode", type: "id", value: "plan" },
],
});
});
const [claude] = sdk.processes;
expect(claude.setModel).toHaveBeenCalledWith("haiku");
expect(claude.setPermissionMode).toHaveBeenCalledWith("plan");
expect(values(response.configOptions)).toMatchObject({ model: "haiku", mode: "plan" });
expect(values(response.configOptions).effort).not.toBe("high");
expect(client.notifications).toEqual([]);
});
it.each<[string, v2.InitialSessionConfigOption[]]>([
[
"two entries of one configId",
[
{ configId: "mode", type: "id", value: "plan" },
{ configId: "mode", type: "id", value: "default" },
],
],
["a value type it does not take", [{ configId: "mode", type: "_custom", value: 1 }]],
])("rejects %s before it starts a query", async (_name, configOptions) => {
const client = v2Client();
const errors = await client.connect(async (agent) => {
await initialize(agent);
return Promise.all(
[
agent.request(v2.methods.agent.session.new, { cwd, configOptions }),
agent.request(v2.methods.agent.session.resume, {
sessionId: STORED,
cwd,
configOptions,
}),
].map((request) => request.catch((error: unknown) => error)),
);
});
expect(errors).toEqual([
expect.objectContaining({ code: -32602 }),
expect.objectContaining({ code: -32602 }),
]);
expect(sdk.processes).toHaveLength(0);
});
it("sets the configOptions of a session/resume on the session, an active one too", async () => {
const client = v2Client();
const { started, active } = await client.connect(async (agent) => {
await initialize(agent);
const resume = (configOptions: v2.InitialSessionConfigOption[]) =>
agent.request(v2.methods.agent.session.resume, { sessionId: STORED, cwd, configOptions });
const started = await resume([{ configId: "mode", type: "id", value: "plan" }]);
const active = await resume([{ configId: "model", type: "id", value: "haiku" }]);
return { started, active };
});
expect(sdk.processes).toHaveLength(1);
expect(values(started.configOptions).mode).toBe("plan");
expect(values(active.configOptions)).toMatchObject({ mode: "plan", model: "haiku" });
expect(client.sessionUpdates.map((update) => update.sessionUpdate)).not.toContain(
"config_option_update",
);
});
it("leaves the notice of an Auto mode fallback for the first prompt", async () => {
const client = v2Client();
const { response, before } = await client.connect(async (agent) => {
await initialize(agent);
const response = await agent.request(v2.methods.agent.session.new, {
cwd,
configOptions: [
{ configId: "mode", type: "id", value: "auto" },
// Haiku cannot serve Auto.
{ configId: "model", type: "id", value: "haiku" },
],
});
const before = [...client.sessionUpdates];
const claude = sdk.processes[0];
const prompted = agent.request(v2.methods.agent.session.prompt, {
sessionId: response.sessionId,
prompt: PROMPT,
});
const prompt = await claude.prompt(0);
claude.send(lifecycle(prompt, "started"));
claude.send(echo(prompt));
claude.send(result());
claude.send(sessionState("idle"));
await prompted;
return { response, before };
});
expect(values(response.configOptions)).toMatchObject({ mode: "acceptEdits", model: "haiku" });
expect(before).toEqual([]);
expect(client.sessionUpdates.filter((update) => update.sessionUpdate === "notice")).toEqual([
expect.objectContaining({ title: "Auto mode unavailable" }),
]);
});
});
it("rejects additional directories that are not absolute", async () => {
const client = v2Client();
const error = await client.connect(async (agent) => {
@@ -1964,6 +2200,49 @@ describe("ACP v2 core", () => {
]);
});
it("replays the messages before a compaction from the transcript", async () => {
const sessionId = randomUUID();
// The records of `/compact` between two prompts, as Claude Code writes
// them: the boundary has no parent and links "Hello" logically. The SDK
// looks the project up by the real path of `cwd` (`/private/var` on macOS).
const project = (await realpath(cwd)).replace(/[^a-zA-Z0-9]/g, "-");
await writeTranscript(path.join(tempDir, "claude", "projects", project), sessionId, [
transcriptUser("u1", "hi"),
transcriptAssistant("a1", "Hello"),
transcriptCompactBoundary("b1", "a1"),
transcriptCompactSummary("s1"),
transcriptUser("u2", "identify yourself"),
]);
// The transcript read and the read across the compaction both go to disk.
const actual = await vi.importActual<typeof import("@anthropic-ai/claude-agent-sdk")>(
"@anthropic-ai/claude-agent-sdk",
);
vi.mocked(getSessionMessages)
.mockImplementationOnce(actual.getSessionMessages)
.mockImplementationOnce(actual.getSessionMessages);
const client = v2Client();
await client.connect(async (agent) => {
await agent.request(v2.methods.agent.initialize, {
protocolVersion: v2.PROTOCOL_VERSION,
info: { name: "v2-test-client", version: "1.0.0" },
capabilities: {},
});
await agent.request(v2.methods.agent.session.resume, {
sessionId,
cwd,
replayFrom: { type: "start" },
});
});
expect(
client.sessionUpdates.flatMap((update) =>
update.sessionUpdate === "user_message" || update.sessionUpdate === "compaction_update"
? [update.sessionUpdate]
: [],
),
).toEqual(["user_message", "compaction_update", "user_message"]);
});
it.each([
[
"a prompt that Claude Code started after the cancel answered it",

View File

@@ -15,6 +15,7 @@ import {
ForkSessionResponse,
InitializeRequest,
InitializeResponse,
InitialSessionConfigOption,
ListProvidersRequest,
ListProvidersResponse,
McpServer,
@@ -43,6 +44,8 @@ import {
SetSessionConfigOptionResponse,
SetSessionModeRequest,
SetSessionModeResponse,
SessionOptionsRequest,
SessionOptionsResponse,
SessionStatusRequest,
SessionStatusResponse,
CloseSessionRequest,
@@ -96,6 +99,11 @@ import {
import { checklistPlanUpdate, resetPlanUpdates, type SubagentChecklists } from "../plans.js";
import { PromptSuggestions } from "../prompt-suggestions.js";
import { savedSessionStatus, SESSION_STATUS_CAPABILITY } from "../session-status.js";
import {
applyInitialConfigOptions,
initialConfigOptions,
SESSION_OPTIONS_CAPABILITY,
} from "../initial-config-options.js";
import { sanitizeTitle, SessionTitles } from "../session-titles.js";
import {
AIR_NATIVE_SUBAGENT_SESSIONS_CAPABILITY,
@@ -203,6 +211,7 @@ import {
replaySubagentTerminalState,
} from "../subagent-replay.js";
import {
readHistoryAcrossCompactions,
readResumedSession,
readResumedTail,
type ResumedSessionSnapshot,
@@ -2024,6 +2033,8 @@ export class ClaudeAcpAgent {
delete: {},
fork: {},
list: {},
// `session/options`, and `configOptions` on `session/new`, `load` and `resume`.
options: SESSION_OPTIONS_CAPABILITY,
resume: {},
status: SESSION_STATUS_CAPABILITY,
systemPrompt: SYSTEM_PROMPT_CAPABILITY,
@@ -2109,15 +2120,77 @@ export class ClaudeAcpAgent {
}
async newSession(params: NewSessionRequest): Promise<NewSessionResponse> {
// Without `configOptions`: a restart of the query restores the session's choices itself.
const { configOptions, ...request } = params;
const initial = initialConfigOptions(configOptions);
while (this.providerUpdate) await this.providerUpdate;
const response = await this.createSession(params, {
const created = await this.createSession(request, {
// Revisit these meta values once we support resume
resume: (params._meta as NewSessionMeta | undefined)?.claudeCode?.options?.resume,
});
const response = await this.withInitialConfigOptions(created, initial);
this.afterSetupResponse(response.sessionId, params.mcpServers);
return response;
}
/**
* `session/options`: the modes and config options that `session/new` with
* the same `cwd`, additional directories and `_meta` would answer with, or
* `session/load` and `session/resume` of `sessionId`.
*
* A session that this connection holds answers with what it has now.
* Otherwise a query starts as the session's would, without MCP servers, and
* closes once its options are read (`optionsOnly` in `createSession`). The
* query does not persist: it stores no session, and it does not write to
* the transcript of `sessionId`. Claude Code runs the user's `SessionStart`
* hooks in it, as in every query.
*
* It sends no update, and it creates, loads and changes no session. A
* `sessionId` without a stored conversation fails with `-32002`.
*/
async sessionOptions(params: SessionOptionsRequest): Promise<SessionOptionsResponse> {
while (this.providerUpdate) await this.providerUpdate;
const held = params.sessionId != null ? this.sessions[params.sessionId] : undefined;
if (held) {
await this.validateCwd(params.cwd, params.additionalDirectories);
return { modes: held.modes, configOptions: held.configOptions };
}
const { modes, configOptions } = await this.createSession(
{
cwd: params.cwd,
mcpServers: [],
additionalDirectories: params.additionalDirectories,
_meta: params._meta,
},
{ resume: params.sessionId ?? undefined, optionsOnly: true },
);
return { modes, configOptions };
}
/**
* The setup response once the request's `configOptions` are set on the
* session, in list order, as `session/set_config_option` sets each one. An
* entry that the session refuses is skipped (`applyInitialConfigOptions`).
* No update goes out for them: the response carries the modes and options.
*/
private async withInitialConfigOptions<R extends NewSessionResponse>(
response: R,
entries: readonly InitialSessionConfigOption[],
): Promise<R> {
if (entries.length === 0) return response;
const { sessionId } = response;
await this.serializeConfigurationChange(sessionId, () =>
applyInitialConfigOptions(
entries,
(entry) => this.selectSessionConfigOption({ ...entry, sessionId }, true),
this.logger,
),
);
const session = this.sessions[sessionId];
if (!session) return response;
return { ...response, modes: session.modes, configOptions: session.configOptions };
}
/**
* Start the CLI of a loaded session, and replay the history while the CLI
* starts. The CLI start takes most of the load time, and the replay needs
@@ -2223,8 +2296,12 @@ export class ClaudeAcpAgent {
}
async resumeSession(params: ResumeSessionRequest): Promise<ResumeSessionResponse> {
const initial = initialConfigOptions(params.configOptions);
while (this.providerUpdate) await this.providerUpdate;
const result = await this.getOrCreateSession(params);
const result = await this.withInitialConfigOptions(
await this.getOrCreateSession(params),
initial,
);
this.afterSetupResponse(params.sessionId, params.mcpServers ?? []);
return result;
@@ -2232,6 +2309,7 @@ export class ClaudeAcpAgent {
async loadSession(params: LoadSessionRequest): Promise<LoadSessionResponse> {
const timing = new SessionTiming(this.logger, "load", params.sessionId);
const initial = initialConfigOptions(params.configOptions);
while (this.providerUpdate) await this.providerUpdate;
let result: NewSessionResponse;
if (this.sessions[params.sessionId]) {
@@ -2243,6 +2321,7 @@ export class ClaudeAcpAgent {
result = await this.createSessionWhileReplaying(params, timing);
}
timing.phase("replay");
result = await this.withInitialConfigOptions(result, initial);
// After the replay, so the commands do not interleave with the history.
this.afterSetupResponse(params.sessionId, params.mcpServers ?? []);
@@ -7904,8 +7983,14 @@ export class ClaudeAcpAgent {
);
}
/**
* `duringSetup`: the value is one of a setup request's `configOptions`. No
* mode update goes out, and the warning of an Auto mode fallback waits for
* the next prompt.
*/
private async selectSessionConfigOption(
params: SetSessionConfigOptionRequest,
duringSetup = false,
): Promise<SetSessionConfigOptionResponse> {
const session = this.sessions[params.sessionId];
if (!session) {
@@ -7936,8 +8021,12 @@ export class ClaudeAcpAgent {
let effectiveValue = resolvedValue;
if (params.configId === MODE_CONFIG_ID) {
effectiveValue = await this.sessionModes.selectMode(params.sessionId, resolvedValue);
await this.sessionModes.publishCurrent(params.sessionId, effectiveValue);
effectiveValue = await this.sessionModes.selectMode(
params.sessionId,
resolvedValue,
duringSetup,
);
if (!duringSetup) await this.sessionModes.publishCurrent(params.sessionId, effectiveValue);
} else if (params.configId === MODEL_CONFIG_ID) {
await this.sessions[params.sessionId].query.setModel(resolvedValue);
}
@@ -7945,7 +8034,13 @@ export class ClaudeAcpAgent {
// effort changes and effort changes induced by a model switch go through
// the same path.
await this.applyConfigOptionValue(params.sessionId, session, params.configId, effectiveValue);
await this.applyConfigOptionValue(
params.sessionId,
session,
params.configId,
effectiveValue,
duringSetup,
);
return { configOptions: session.configOptions };
}
@@ -7957,7 +8052,12 @@ export class ClaudeAcpAgent {
): Promise<void> {
const replayStartedAt = performance.now();
const toolUseCache: ToolUseCache = {};
const messages = resumedMessages ?? (await getSessionMessages(sessionId));
// A load replays the messages before each compaction too, unless reading them fails.
const messages = await readHistoryAcrossCompactions(
sessionId,
resumedMessages ?? (await getSessionMessages(sessionId)),
this.logger,
);
const historyLoadedAt = performance.now();
this.logger.log(
`[session/replay] sessionId=${sessionId} phase=read durationMs=${Math.round(historyLoadedAt - replayStartedAt)} messages=${messages.length}`,
@@ -9456,6 +9556,8 @@ export class ClaudeAcpAgent {
session: Session,
configId: string,
value: string,
/** See {@link selectSessionConfigOption}. */
duringSetup = false,
): Promise<void> {
if (configId === MODE_CONFIG_ID) {
this.sessionModes.syncConfig(session, value);
@@ -9565,7 +9667,8 @@ export class ClaudeAcpAgent {
// still precedes the caller's config_option_update so order-sensitive
// clients update currentModeId before re-rendering the option list.
if (modeDowngraded) {
await this.sessionModes.publishFallbackState(sessionId, session);
if (duringSetup) this.sessionModes.deferFallbackWarning(session);
else await this.sessionModes.publishFallbackState(sessionId, session);
}
// Last, so the switch's own control requests don't queue behind it.
if (modelChanged) this.refreshContextWindowInBackground(sessionId, session);
@@ -9864,6 +9967,12 @@ export class ClaudeAcpAgent {
replayState?: ReplayState;
/** A close of this session during startup cancels registration of its replacement. */
replacingSession?: Session;
/**
* `session/options`: the query answers with the modes and config options
* and closes. No session is registered, and Claude Code stores nothing
* of the query (`persistSession: false`).
*/
optionsOnly?: boolean;
} = {},
): Promise<NewSessionResponse> {
const createStartedAt = performance.now();
@@ -10256,6 +10365,7 @@ export class ClaudeAcpAgent {
},
...(creationOpts.resume !== undefined && { resume: creationOpts.resume }),
...(creationOpts.forkSession !== undefined && { forkSession: creationOpts.forkSession }),
...(creationOpts.optionsOnly ? { persistSession: false } : {}),
abortController,
};
@@ -10475,6 +10585,10 @@ export class ClaudeAcpAgent {
},
ultracode,
);
if (creationOpts.optionsOnly) {
this.discardUnregisteredQuery(q, input, settingsManager);
return { sessionId, modes, configOptions };
}
const initialEffort = configOptions.find((option) => option.id === EFFORT_CONFIG_ID);
if (useRecommendedValue && typeof initialEffort?.currentValue === "string") {
await q.applyFlagSettings(effortFlagSettings(initialEffort.currentValue, ultracodeEnabled));
@@ -10593,7 +10707,8 @@ export class ClaudeAcpAgent {
this.claudeIsWorking(sessionId, registered) ||
(registered.openUserInputs?.size ?? 0) > 0,
contextTokens: () => registered.contextUsedTokens,
settings: () => registered.settingsManager.getSettings(),
settings: () =>
registered.settingsManager.getCompactionSettings(configuredSettingsObject),
compact: () =>
this.prompt(
{ sessionId, prompt: [{ type: "text", text: "/compact" }] },
@@ -11162,6 +11277,7 @@ export function v1AgentApp(
.onRequest(methods.agent.session.resume, (ctx) => agent.resumeSession(ctx.params))
.onRequest(methods.agent.session.close, (ctx) => agent.closeSession(ctx.params))
.onRequest(methods.agent.session.status, (ctx) => agent.sessionStatus(ctx.params))
.onRequest(methods.agent.session.options, (ctx) => agent.sessionOptions(ctx.params))
.onRequest(methods.agent.session.setMode, (ctx) => agent.setSessionMode(ctx.params))
.onRequest(methods.agent.session.setConfigOption, (ctx) =>
agent.setSessionConfigOption(ctx.params),

View File

@@ -39,7 +39,11 @@ import { forkSession } from "../fork-session.js";
import { supportsMcpOAuth } from "../mcp-oauth.js";
import { sdkMcpServers } from "../mcp-servers.js";
import { ALLOW_BYPASS, autoModeDisabled } from "../permissions/modes.js";
import { readResumedTail, resumedModelFromTranscript } from "../resumed-session.js";
import {
readHistoryAcrossCompactions,
readResumedTail,
resumedModelFromTranscript,
} from "../resumed-session.js";
import { mergeEffortSettings } from "../session-effort.js";
import { configuredSettings, resolveThinkingConfig } from "../session-env.js";
import { resolveInitialPermissionMode } from "../session-mode.js";
@@ -55,7 +59,12 @@ import { STARTUP_FAILURE_RESULTS_ENV, startupFailureError } from "../startup-fai
import { createPostToolUseHook } from "../tools.js";
import { Pushable } from "../utils.js";
import { V2_SESSION_CAPABILITIES } from "./initialize.js";
import { v1ForkSessionRequest, v1NewSessionRequest } from "./session-requests.js";
import {
initialConfigRequests,
v1ForkSessionRequest,
v1NewSessionRequest,
} from "./session-requests.js";
import { SessionCommands } from "./commands.js";
import { V2UpdateTranslator } from "./update-translator.js";
import { airInitializeMeta, airSupport, NO_AIR, type AirSupport } from "./air.js";
import { V2Auth } from "./auth.js";
@@ -114,6 +123,7 @@ export function v2AgentApp(
.onRequest(v2.methods.agent.session.list, ({ params }) => agent.listSessions(params))
.onRequest(v2.methods.agent.session.close, ({ params }) => agent.closeSession(params))
.onRequest(v2.methods.agent.session.status, ({ params }) => agent.sessionStatus(params))
.onRequest(v2.methods.agent.session.options, ({ params }) => agent.sessionOptions(params))
.onRequest(v2.methods.agent.session.delete, ({ params }) => agent.deleteSession(params))
.onRequest(v2.methods.agent.session.setTitle, ({ params }) => agent.setTitle(params))
.onRequest(v2.methods.agent.session.setConfigOption, ({ params }) =>
@@ -317,7 +327,9 @@ class V2Agent implements AgentHandle, SessionConnection {
async newSession(params: v2.NewSessionRequest): Promise<v2.NewSessionResponse> {
const sessionId = randomUUID();
const initial = initialConfigRequests(sessionId, params.configOptions);
const session = await this.startSession(sessionId, params, undefined);
await session.setInitialConfigOptions(initial);
const response = { sessionId, ...(await this.setupFields(session)) };
this.afterSetup(session, params);
return response;
@@ -344,7 +356,9 @@ class V2Agent implements AgentHandle, SessionConnection {
/**
* Resumes a stored session, or attaches to a live one. With `replayFrom:
* { type: "start" }` the stored history replays first. Either way, the
* state snapshot goes out after any replay and before the response.
* state snapshot goes out after any replay and before the response. The
* request's `configOptions` are set before the replay, on an active session
* too.
*/
resumeSession(params: v2.ResumeSessionRequest): Promise<v2.ResumeSessionResponse> {
const { sessionId } = params;
@@ -370,23 +384,21 @@ class V2Agent implements AgentHandle, SessionConnection {
);
}
if (this.ownerOfChild(sessionId)) throw restrictedChild(sessionId, "resume");
const initial = initialConfigRequests(sessionId, params.configOptions);
await this.restarts.settled(sessionId);
// A concurrent resume of this session started its query: this one then
// attaches to the session that it started.
await this.startSettled(sessionId);
let session = this.sessions.get(sessionId);
let history: Promise<SessionMessage[]> | undefined;
// The replay: the messages before each compaction too, unless reading them fails.
let replayed: Promise<SessionMessage[]> | undefined;
if (session) {
// Resuming the active session synchronizes it again. Its work goes on,
// and the request's MCP servers and additional directories replace the
// session's.
const request = await validatedSetup(params);
if (request.cwd !== session.cwd) {
throw RequestError.invalidParams(
{ cwd: request.cwd },
`Session ${sessionId} works in ${session.cwd}: resume it with that \`cwd\``,
);
}
assertCwdOf(session, request.cwd, "resume it");
await session.setMcpServers({
...clientOptions(params._meta)?.mcpServers,
...sdkMcpServers(request.mcpServers),
@@ -402,13 +414,23 @@ class V2Agent implements AgentHandle, SessionConnection {
} else {
// One read of the transcript serves the replay and the resumed model.
history = replayFrom != null ? getSessionMessages(sessionId, { dir: params.cwd }) : undefined;
// A failed start leaves it unawaited.
// The read across compactions overlaps the start of the query.
replayed = history?.then((messages) =>
readHistoryAcrossCompactions(sessionId, messages, this.logger, params.cwd),
);
// A failed start leaves them unawaited.
history?.catch(() => {});
replayed?.catch(() => {});
session = await this.startSession(sessionId, params, sessionId, history);
}
await session.setInitialConfigOptions(initial);
let subagents: SubagentReplay | undefined;
if (replayFrom != null) {
const messages = await (history ?? getSessionMessages(sessionId, { dir: session.cwd }));
const cwd = session.cwd;
const messages = await (replayed ??
getSessionMessages(sessionId, { dir: cwd }).then((chain) =>
readHistoryAcrossCompactions(sessionId, chain, this.logger, cwd),
));
subagents = await session.tasks.loadReplay(messages);
session.output.replay(
messages,
@@ -482,6 +504,66 @@ class V2Agent implements AgentHandle, SessionConnection {
return savedSessionStatus(sessionId);
}
/**
* `session/options`: the config options and commands that `session/new`
* with the same `cwd`, additional directories and `_meta` would answer
* with, or `session/resume` of `sessionId`.
*
* An active session answers with what it has now. Otherwise a query starts
* as the session's would, without MCP servers, and closes once its options
* are read. So the commands lack the MCP prompts, and a failed read of the
* commands leaves them out. The query does not persist
* (`persistSession: false`): it stores no session, and it does not write to
* the transcript of `sessionId`. Claude Code runs the user's `SessionStart`
* hooks in it, as in every query.
*
* It sends no update, and it creates, resumes and changes no session. A
* `sessionId` without a stored conversation fails with `-32002`.
*/
async sessionOptions(params: v2.SessionOptionsRequest): Promise<v2.SessionOptionsResponse> {
const { sessionId } = params;
const setup: v2.NewSessionRequest = {
cwd: params.cwd,
additionalDirectories: params.additionalDirectories,
_meta: params._meta,
};
let session: V2Session | undefined;
if (sessionId != null) {
if (this.ownerOfChild(sessionId)) throw restrictedChild(sessionId, "read the options of");
// A restart or a resume that runs makes the session active.
await this.restarts.settled(sessionId);
await this.startSettled(sessionId);
session = this.sessions.get(sessionId);
}
const fields = (config: SessionConfig, commands: v2.AvailableCommand[]) => ({
configOptions: config.options(),
// The draft leaves out an empty list.
...(commands.length > 0 ? { availableCommands: commands } : {}),
});
const listed = (commands: SessionCommands) =>
commands.list().catch((error: unknown) => {
this.logger.error("session/options: failed to read the commands", error);
return [];
});
if (session) {
assertCwdOf(session, (await validatedSetup(setup)).cwd, "ask for its options");
return fields(session.config, await listed(session.commands));
}
// The probe's own id: its records never meet those of the session `sessionId`.
const probeId = randomUUID();
const probe = await this.openQuery(probeId, setup, sessionId ?? undefined, undefined, {
persist: false,
});
try {
return fields(probe.config, await listed(new SessionCommands(probe.query)));
} finally {
probe.query.close();
probe.settings.dispose();
this.auth.sessionEnded(probeId);
this.guard.sessionEnded(probeId);
}
}
/** Closing is idempotent: a session that is not active closes at once. */
async closeSession({ sessionId }: v2.CloseSessionRequest): Promise<v2.CloseSessionResponse> {
if (this.ownerOfChild(sessionId)) throw restrictedChild(sessionId, "close");
@@ -718,10 +800,7 @@ class V2Agent implements AgentHandle, SessionConnection {
return start;
}
/**
* The query start of {@link startSession}. Its options are the client's
* `_meta.claudeCode.options` under the ones this core controls.
*/
/** The query start of {@link startSession}: {@link openQuery}, then the session is active. */
private async launchSession(
sessionId: string,
params: v2.NewSessionRequest | v2.ResumeSessionRequest | v2.ForkSessionRequest,
@@ -729,6 +808,50 @@ class V2Agent implements AgentHandle, SessionConnection {
/** The resumed transcript, when the caller reads it anyway (a replay). */
history?: Promise<SessionMessage[]>,
): Promise<V2Session> {
const {
session,
query: q,
config,
models,
...opened
} = await this.openQuery(sessionId, params, resume, history);
session.reports.configure({
settings: opened.settings,
configuredSettings: opened.configured,
env: opened.env,
mcpServers: opened.request.mcpServers.map((server) => server.name),
mcpOAuth: this.elicitation.url && supportsMcpOAuth(q),
query: q,
model: { id: models.models.currentModelId, info: models.allowlistedModelInfo },
});
session.start(q, config, opened.mcpServers, resume !== undefined);
this.sessions.set(sessionId, session);
this.stopped.delete(sessionId);
// A route change during the start did not find this session live.
this.restarts.track(sessionId, params, {
staleRoute: this.auth.routeGeneration !== opened.routeGeneration,
});
return session;
}
/**
* Starts the query of a session and builds its config. Its options are the
* client's `_meta.claudeCode.options` under the ones this core controls.
* The session is not active yet, and nothing of it goes out. The caller
* closes the query and disposes the settings when it does not keep them.
*
* `resume`: the stored session that the query resumes, `sessionId` itself
* but for a `session/options` probe. Without `persist`, Claude Code stores
* nothing of the query (see {@link sessionOptions}).
*/
private async openQuery(
sessionId: string,
params: v2.NewSessionRequest | v2.ResumeSessionRequest | v2.ForkSessionRequest,
resume: string | undefined,
/** The resumed transcript, when the caller reads it anyway (a replay). */
history?: Promise<SessionMessage[]>,
{ persist = true } = {},
) {
const request = await validatedSetup(params);
const client = clientOptions(params._meta);
// After a provider change that is still listing its models.
@@ -877,6 +1000,7 @@ class V2Agent implements AgentHandle, SessionConnection {
...STARTUP_FAILURE_RESULTS_ENV,
},
...(resume !== undefined ? { resume } : { sessionId }),
...(persist ? {} : { persistSession: false }),
};
const q = query({ prompt: input, options });
let initialization;
@@ -890,7 +1014,7 @@ class V2Agent implements AgentHandle, SessionConnection {
error instanceof Error &&
error.message.includes("No conversation found with session ID")
) {
throw RequestError.sessionNotFound(sessionId);
throw RequestError.sessionNotFound(resume);
}
throw startupFailureError(error) ?? error;
}
@@ -952,22 +1076,18 @@ class V2Agent implements AgentHandle, SessionConnection {
settings.dispose();
throw error;
}
session.reports.configure({
settings,
env: options.env ?? {},
mcpServers: request.mcpServers.map((server) => server.name),
mcpOAuth: this.elicitation.url && supportsMcpOAuth(q),
return {
session,
query: q,
model: { id: models.models.currentModelId, info: models.allowlistedModelInfo },
});
session.start(q, config, mcpServers, resume !== undefined);
this.sessions.set(sessionId, session);
this.stopped.delete(sessionId);
// A route change during the start did not find this session live.
this.restarts.track(sessionId, params, {
staleRoute: this.auth.routeGeneration !== routeGeneration,
});
return session;
config,
models,
settings,
configured,
env: options.env ?? {},
request,
mcpServers,
routeGeneration,
};
}
}
@@ -1002,6 +1122,15 @@ async function validatedSetup(
return request;
}
/** A request of the active `session` names its `cwd`, as `session/resume` must. */
function assertCwdOf(session: V2Session, cwd: string, action: string): void {
if (cwd === session.cwd) return;
throw RequestError.invalidParams(
{ cwd },
`Session ${session.sessionId} works in ${session.cwd}: ${action} with that \`cwd\``,
);
}
function sameDirectories(left: readonly string[], right: readonly string[]): boolean {
const normalize = (directories: readonly string[]) =>
[...new Set(directories.map((directory) => path.resolve(directory)))].sort().join("\n");

View File

@@ -43,6 +43,7 @@ import type {
Query,
Settings,
} from "@anthropic-ai/claude-agent-sdk";
import { applyInitialConfigOptions } from "../initial-config-options.js";
import type { Logger } from "../logger.js";
import type { SubagentModels } from "../native-subagents.js";
import { DEFAULT_AGENT_ID } from "../session-config-ids.js";
@@ -346,6 +347,19 @@ export class SessionConfig {
return this.serialized(() => this.apply(params));
}
/**
* Sets the initial values of a setup request's `configOptions`, in list
* order, as {@link set} sets each one. An entry that the session refuses is
* skipped (`applyInitialConfigOptions`). Nothing goes out: the setup
* response carries the options, and the notice of an Auto mode fallback
* waits for the next prompt.
*/
setInitial(entries: readonly v2.SetSessionConfigOptionRequest[]): Promise<void> {
return this.serialized(() =>
applyInitialConfigOptions(entries, (entry) => this.apply(entry, true), this.logger),
);
}
/**
* Sets the choices of `previous`, the config of the query that this one
* replaced (see `restarts.ts`), as the v1 core's `restoreSessionChoices`
@@ -411,7 +425,11 @@ export class SessionConfig {
return result;
}
private async apply(params: v2.SetSessionConfigOptionRequest): Promise<void> {
/** `duringSetup`: see {@link setInitial}. */
private async apply(
params: v2.SetSessionConfigOptionRequest,
duringSetup = false,
): Promise<void> {
const request = v1SetSessionConfigOptionRequest(params);
const option = this.session.configOptions.find((entry) => entry.id === request.configId);
if (!option) {
@@ -429,11 +447,11 @@ export class SessionConfig {
const value = selected.value;
switch (request.configId) {
case MODE_CONFIG_ID:
await this.applyMode(value as PermissionMode);
await this.applyMode(value as PermissionMode, duringSetup);
return;
case MODEL_CONFIG_ID:
await this.session.query.setModel(value);
await this.recordModel(value);
await this.recordModel(value, duringSetup);
return;
case EFFORT_CONFIG_ID:
// Applied first, so a rejected control request leaves the option as it was.
@@ -472,11 +490,17 @@ export class SessionConfig {
return this.rules.effectiveMode(this.session, requested);
}
private async applyMode(requested: PermissionMode): Promise<void> {
private async applyMode(requested: PermissionMode, duringSetup = false): Promise<void> {
const mode = this.rules.effectiveMode(this.session, requested);
await this.session.query.setPermissionMode(mode);
this.rules.syncConfig(this.session, mode);
if (mode !== requested) await this.rules.publishFallbackWarning(this.sessionId, this.session);
if (mode !== requested) await this.warnOfFallback(duringSetup);
}
/** The notice of an Auto mode fallback: now, or with the next prompt during setup. */
private async warnOfFallback(duringSetup: boolean): Promise<void> {
if (duringSetup) this.rules.deferFallbackWarning(this.session);
else await this.rules.publishFallbackWarning(this.sessionId, this.session);
}
/** Claude Code switched the mode itself. Returns whether the option changed. */
@@ -606,7 +630,7 @@ export class SessionConfig {
* show only on a model that supports them, with the user's retained
* choice.
*/
private async recordModel(value: string): Promise<void> {
private async recordModel(value: string, duringSetup = false): Promise<void> {
const info = this.modelInfos.find((model) => model.value === value);
this.session.models = { ...this.session.models, currentModelId: value };
const modeDowngraded = await this.rules.reconcileForModel(this.session, info);
@@ -664,7 +688,7 @@ export class SessionConfig {
effort.error,
);
}
if (modeDowngraded) await this.rules.publishFallbackWarning(this.sessionId, this.session);
if (modeDowngraded) await this.warnOfFallback(duringSetup);
}
}

View File

@@ -6,6 +6,7 @@
import type { AuthMethod } from "@agentclientprotocol/sdk/unstable";
import type * as v2 from "@agentclientprotocol/sdk/experimental/v2/unstable";
import { SYSTEM_PROMPT_CAPABILITY } from "../client-system-prompt.js";
import { SESSION_OPTIONS_CAPABILITY } from "../initial-config-options.js";
import { SESSION_STATUS_CAPABILITY } from "../session-status.js";
/**
@@ -19,6 +20,8 @@ import { SESSION_STATUS_CAPABILITY } from "../session-status.js";
* images, embedded context, and HTTP servers. v2 has no SSE transport.
* - `systemPrompt`, in `append` and `override` mode.
* - `session/status` (unstable), with the foreground state of an open session.
* - `session/options` (unstable), and `configOptions` on `session/new` and
* `session/resume`.
*/
export const V2_SESSION_CAPABILITIES: v2.SessionCapabilities = {
prompt: { image: {}, embeddedContext: {} },
@@ -28,6 +31,7 @@ export const V2_SESSION_CAPABILITIES: v2.SessionCapabilities = {
additionalDirectories: {},
systemPrompt: SYSTEM_PROMPT_CAPABILITY,
status: SESSION_STATUS_CAPABILITY,
options: SESSION_OPTIONS_CAPABILITY,
// `session/set_title`.
title: {},
};

View File

@@ -21,6 +21,7 @@ import type {
SDKMessage,
SDKPartialAssistantMessage,
SDKResultMessage,
Settings,
} from "@anthropic-ai/claude-agent-sdk";
import type { Logger } from "../logger.js";
import type { AcpSessionNotification } from "../acp-subagents.js";
@@ -78,7 +79,9 @@ export interface ReportsHost {
/** What the session's query was started with (see {@link SessionReports.configure}). */
export interface ReportsSetup {
/** The session's live Claude Code settings, disposed with the reports. */
settings: Pick<SettingsManager, "getSettings" | "dispose">;
settings: Pick<SettingsManager, "getCompactionSettings" | "dispose">;
/** The client's `settings` option, which the query got as `--settings`. */
configuredSettings: Settings | undefined;
/** The query's environment. */
env: Record<string, string | undefined>;
/** The names of the client's MCP servers. */
@@ -172,7 +175,7 @@ export class SessionReports {
{
isBusy: () => this.host.isBusy(),
contextTokens: () => this.contextUsed,
settings: () => setup.settings.getSettings(),
settings: () => setup.settings.getCompactionSettings(setup.configuredSettings),
compact: () => this.host.compact(),
// The logger has no debug level.
log: (message) => this.host.logger.log(message),

View File

@@ -16,11 +16,17 @@ import {
type SystemPrompt,
} from "@agentclientprotocol/sdk/unstable";
import * as v2 from "@agentclientprotocol/sdk/experimental/v2/unstable";
import { initialConfigOptions } from "../initial-config-options.js";
import { V2_SESSION_CAPABILITIES } from "./initialize.js";
import { v1ContentBlock } from "./prompt.js";
/**
* Without `configOptions`: the session applies them once it started (see
* {@link initialConfigRequests}).
*/
export function v1NewSessionRequest(params: v2.NewSessionRequest): NewSessionRequest {
const { mcpServers, systemPrompt, ...request } = params;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { mcpServers, systemPrompt, configOptions, ...request } = params;
// v1 requires the list; v2 treats an omitted list as an empty one.
return {
...request,
@@ -71,6 +77,23 @@ export function v1SetSessionConfigOptionRequest(
);
}
/**
* The `configOptions` of a setup request, as the `session/set_config_option`
* requests of `sessionId` that set them. Fails with invalid params (-32602)
* for two entries with the same `configId`, and for an entry of a value type
* that `session/set_config_option` does not take: any but `id` and `boolean`.
*/
export function initialConfigRequests(
sessionId: string,
entries: v2.InitialSessionConfigOption[] | null | undefined,
): v2.SetSessionConfigOptionRequest[] {
return initialConfigOptions(entries).map((entry) => {
const request = { ...entry, sessionId };
v1SetSessionConfigOptionRequest(request);
return request;
});
}
/** v2 names the id of an option `configId` and the id of a select group `groupId`. */
export function v2ConfigOptions(options: SessionConfigOption[]): v2.SessionConfigOption[] {
return options.map((option) => {

View File

@@ -621,6 +621,22 @@ export class V2Session implements RequestTarget {
if (heldTurn) this.closeTurn();
}
/**
* Sets the initial values of a setup request's `configOptions` (see
* `SessionConfig.setInitial`), and has the reports follow the model they
* leave. It sends nothing, on a session that a `session/resume` found
* active too: the setup response carries the options to the connection
* that asked, and a session is active on one connection only.
*/
async setInitialConfigOptions(
entries: readonly v2.SetSessionConfigOptionRequest[],
): Promise<void> {
if (entries.length === 0) return;
await this.config.setInitial(entries);
// Nothing changes for the same model.
this.modelChangedReports();
}
async setConfigOption(
params: v2.SetSessionConfigOptionRequest,
): Promise<v2.SessionConfigOption[]> {