惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
Blog — PlanetScale
Blog — PlanetScale
博客园 - 【当耐特】
博客园_首页
The GitHub Blog
The GitHub Blog
月光博客
月光博客
Hugging Face - Blog
Hugging Face - Blog
有赞技术团队
有赞技术团队
博客园 - 三生石上(FineUI控件)
D
Docker
Stack Overflow Blog
Stack Overflow Blog
WordPress大学
WordPress大学
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Apple Machine Learning Research
Apple Machine Learning Research
Vercel News
Vercel News
酷 壳 – CoolShell
酷 壳 – CoolShell
雷峰网
雷峰网
小众软件
小众软件
I
InfoQ
A
About on SuperTechFans
T
The Blog of Author Tim Ferriss
S
SegmentFault 最新的问题
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
docs(tools): trim ACP agents reference, merge quick-start...
vincentkoc · 2026-04-24 · via Recent Commits to openclaw:main

@@ -7,7 +7,7 @@ read_when:

77

- Troubleshooting ACP backend and plugin wiring

88

- Debugging ACP completion delivery or agent-to-agent loops

99

- Operating /acp commands from chat

10-

title: "ACP Agents"

10+

title: "ACP agents"

1111

---

12121313

# ACP agents

@@ -32,61 +32,33 @@ There are three nearby surfaces that are easy to confuse:

32323333

## Does this work out of the box?

343435-

Usually, yes.

35+

Usually, yes. Fresh installs ship the bundled `acpx` runtime plugin enabled by default, with a plugin-local pinned `acpx` binary that OpenClaw probes and self-repairs on startup. Run `/acp doctor` for a readiness check.

363637-

- Fresh installs now ship the bundled `acpx` runtime plugin enabled by default.

38-

- The bundled `acpx` plugin prefers its plugin-local pinned `acpx` binary.

39-

- On startup, OpenClaw probes that binary and self-repairs it if needed.

40-

- Start with `/acp doctor` if you want a fast readiness check.

37+

First-run gotchas:

413842-

What can still happen on first use:

43-44-

- A target harness adapter may be fetched on demand with `npx` the first time you use that harness.

39+

- Target harness adapters (Codex, Claude, etc.) may be fetched on demand with `npx` the first time you use them.

4540

- Vendor auth still has to exist on the host for that harness.

46-

- If the host has no npm/network access, first-run adapter fetches can fail until caches are pre-warmed or the adapter is installed another way.

47-48-

Examples:

49-50-

- `/acp spawn codex`: OpenClaw should be ready to bootstrap `acpx`, but the Codex ACP adapter may still need a first-run fetch.

51-

- `/acp spawn claude`: same story for the Claude ACP adapter, plus Claude-side auth on that host.

41+

- If the host has no npm or network access, first-run adapter fetches fail until caches are pre-warmed or the adapter is installed another way.

524253-

## Fast operator flow

43+

## Operator runbook

544455-

Use this when you want a practical `/acp` runbook:

45+

Quick `/acp` flow from chat:

564657-

1. Spawn a session:

58-

- `/acp spawn codex --bind here`

59-

- `/acp spawn codex --mode persistent --thread auto`

60-

2. Work in the bound conversation or thread (or target that session key explicitly).

61-

3. Check runtime state:

62-

- `/acp status`

63-

4. Tune runtime options as needed:

64-

- `/acp model <provider/model>`

65-

- `/acp permissions <profile>`

66-

- `/acp timeout <seconds>`

67-

5. Nudge an active session without replacing context:

68-

- `/acp steer tighten logging and continue`

69-

6. Stop work:

70-

- `/acp cancel` (stop current turn), or

71-

- `/acp close` (close session + remove bindings)

47+

1. **Spawn**`/acp spawn codex --bind here` or `/acp spawn codex --mode persistent --thread auto`

48+

2. **Work** in the bound conversation or thread (or target the session key explicitly).

49+

3. **Check state**`/acp status`

50+

4. **Tune**`/acp model <provider/model>`, `/acp permissions <profile>`, `/acp timeout <seconds>`

51+

5. **Steer** without replacing context — `/acp steer tighten logging and continue`

52+

6. **Stop**`/acp cancel` (current turn) or `/acp close` (session + bindings)

725373-

## Quick start for humans

74-75-

Examples of natural requests:

54+

Natural-language triggers that should route to the ACP runtime:

76557756

- "Bind this Discord channel to Codex."

78-

- "Start a persistent Codex session in a thread here and keep it focused."

57+

- "Start a persistent Codex session in a thread here."

7958

- "Run this as a one-shot Claude Code ACP session and summarize the result."

80-

- "Bind this iMessage chat to Codex and keep follow-ups in the same workspace."

8159

- "Use Gemini CLI for this task in a thread, then keep follow-ups in that same thread."

826083-

What OpenClaw should do:

84-85-

1. Pick `runtime: "acp"`.

86-

2. Resolve the requested harness target (`agentId`, for example `codex`).

87-

3. If current-conversation binding is requested and the active channel supports it, bind the ACP session to that conversation.

88-

4. Otherwise, if thread binding is requested and the current channel supports it, bind the ACP session to the thread.

89-

5. Route follow-up bound messages to that same ACP session until unfocused/closed/expired.

61+

OpenClaw picks `runtime: "acp"`, resolves the harness `agentId`, binds to the current conversation or thread when supported, and routes follow-ups to that session until close/expiry.

90629163

## ACP versus sub-agents

9264

@@ -124,52 +96,27 @@ For operators, the practical rule is:

1249612597

### Current-conversation binds

12698127-

Use `/acp spawn <harness> --bind here` when you want the current conversation to become a durable ACP workspace without creating a child thread.

128-129-

Behavior:

130-131-

- OpenClaw keeps owning the channel transport, auth, safety, and delivery.

132-

- The current conversation is pinned to the spawned ACP session key.

133-

- Follow-up messages in that conversation route to the same ACP session.

134-

- `/new` and `/reset` reset the same bound ACP session in place.

135-

- `/acp close` closes the session and removes the current-conversation binding.

136-137-

What this means in practice:

138-139-

- `--bind here` keeps the same chat surface. On Discord, the current channel stays the current channel.

140-

- `--bind here` can still create a new ACP session if you are spawning fresh work. The bind attaches that session to the current conversation.

141-

- `--bind here` does not create a child Discord thread or Telegram topic by itself.

142-

- The ACP runtime can still have its own working directory (`cwd`) or backend-managed workspace on disk. That runtime workspace is separate from the chat surface and does not imply a new messaging thread.

143-

- If you spawn to a different ACP agent and do not pass `--cwd`, OpenClaw inherits the **target agent's** workspace by default, not the requester's.

144-

- If that inherited workspace path is missing (`ENOENT`/`ENOTDIR`), OpenClaw falls back to the backend default cwd instead of silently reusing the wrong tree.

145-

- If the inherited workspace exists but cannot be accessed (for example `EACCES`), spawn returns the real access error instead of dropping `cwd`.

99+

`/acp spawn <harness> --bind here` pins the current conversation to the spawned ACP session — no child thread, same chat surface. OpenClaw keeps owning transport, auth, safety, and delivery; follow-up messages in that conversation route to the same session; `/new` and `/reset` reset the session in place; `/acp close` removes the binding.

146100147101

Mental model:

148102149-

- chat surface: where people keep talking (`Discord channel`, `Telegram topic`, `iMessage chat`)

150-

- ACP session: the durable Codex/Claude/Gemini runtime state OpenClaw routes to

151-

- child thread/topic: an optional extra messaging surface created only by `--thread ...`

152-

- runtime workspace: the filesystem location where the harness runs (`cwd`, repo checkout, backend workspace)

103+

- **chat surface**where people keep talking (Discord channel, Telegram topic, iMessage chat).

104+

- **ACP session**the durable Codex/Claude/Gemini runtime state OpenClaw routes to.

105+

- **child thread/topic**an optional extra messaging surface created only by `--thread ...`.

106+

- **runtime workspace**the filesystem location (`cwd`, repo checkout, backend workspace) where the harness runs. Independent of the chat surface.

153107154108

Examples:

155109156-

- `/acp spawn codex --bind here`: keep this chat, spawn or attach a Codex ACP session, and route future messages here to it

157-

- `/acp spawn codex --thread auto`: OpenClaw may create a child thread/topic and bind the ACP session there

158-

- `/acp spawn codex --bind here --cwd /workspace/repo`: same chat binding as above, but Codex runs in `/workspace/repo`

159-160-

Current-conversation binding support:

161-162-

- Chat/message channels that advertise current-conversation binding support can use `--bind here` through the shared conversation-binding path.

163-

- Channels with custom thread/topic semantics can still provide channel-specific canonicalization behind the same shared interface.

164-

- `--bind here` always means "bind the current conversation in place".

165-

- Generic current-conversation binds use the shared OpenClaw binding store and survive normal gateway restarts.

110+

- `/acp spawn codex --bind here` — keep this chat, spawn or attach Codex, route future messages here.

111+

- `/acp spawn codex --thread auto` — OpenClaw may create a child thread/topic and bind there.

112+

- `/acp spawn codex --bind here --cwd /workspace/repo` — same chat binding, Codex runs in `/workspace/repo`.

166113167114

Notes:

168115169-

- `--bind here` and `--thread ...` are mutually exclusive on `/acp spawn`.

170-

- On Discord, `--bind here` binds the current channel or thread in place. `spawnAcpSessions` is only required when OpenClaw needs to create a child thread for `--thread auto|here`.

171-

- If the active channel does not expose current-conversation ACP bindings, OpenClaw returns a clear unsupported message.

172-

- `resume` and "new session" questions are ACP-session questions, not channel questions. You can reuse or replace runtime state without changing the current chat surface.

116+

- `--bind here` and `--thread ...` are mutually exclusive.

117+

- `--bind here` only works on channels that advertise current-conversation binding; OpenClaw returns a clear unsupported message otherwise. Bindings persist across gateway restarts.

118+

- On Discord, `spawnAcpSessions` is only required when OpenClaw needs to create a child thread for `--thread auto|here` — not for `--bind here`.

119+

- If you spawn to a different ACP agent without `--cwd`, OpenClaw inherits the **target agent's** workspace by default. Missing inherited paths (`ENOENT`/`ENOTDIR`) fall back to the backend default; other access errors (e.g. `EACCES`) surface as spawn errors.

173120174121

### Thread-bound sessions

175122

@@ -427,45 +374,19 @@ Notes:

427374

- The target agent must support `session/load` (Codex and Claude Code do).

428375

- If the session ID isn't found, the spawn fails with a clear error — no silent fallback to a new session.

429376430-

### Operator smoke test

377+

<Accordion title="Post-deploy smoke test">

431378432-

Use this after a gateway deploy when you want a quick live check that ACP spawn

433-

is actually working end-to-end, not just passing unit tests.

379+

After a gateway deploy, run a live end-to-end check rather than trusting unit tests:

434380435-

Recommended gate:

381+

1. Verify the deployed gateway version and commit on the target host.

382+

2. Open a temporary ACPX bridge session to a live agent.

383+

3. Ask that agent to call `sessions_spawn` with `runtime: "acp"`, `agentId: "codex"`, `mode: "run"`, and task `Reply with exactly LIVE-ACP-SPAWN-OK`.

384+

4. Verify `accepted=yes`, a real `childSessionKey`, and no validator error.

385+

5. Clean up the temporary bridge session.

436386437-

1. Verify the deployed gateway version/commit on the target host.

438-

2. Confirm the deployed source includes the ACP lineage acceptance in

439-

`src/gateway/sessions-patch.ts` (`subagent:* or acp:* sessions`).

440-

3. Open a temporary ACPX bridge session to a live agent (for example

441-

`razor(main)` on `jpclawhq`).

442-

4. Ask that agent to call `sessions_spawn` with:

443-

- `runtime: "acp"`

444-

- `agentId: "codex"`

445-

- `mode: "run"`

446-

- task: `Reply with exactly LIVE-ACP-SPAWN-OK`

447-

5. Verify the agent reports:

448-

- `accepted=yes`

449-

- a real `childSessionKey`

450-

- no validator error

451-

6. Clean up the temporary ACPX bridge session.

387+

Keep the gate on `mode: "run"` and skip `streamTo: "parent"` — thread-bound `mode: "session"` and stream-relay paths are separate richer integration passes.

452388453-

Example prompt to the live agent:

454-455-

```text

456-

Use the sessions_spawn tool now with runtime: "acp", agentId: "codex", and mode: "run".

457-

Set the task to: "Reply with exactly LIVE-ACP-SPAWN-OK".

458-

Then report only: accepted=<yes/no>; childSessionKey=<value or none>; error=<exact text or none>.

459-

```

460-461-

Notes:

462-463-

- Keep this smoke test on `mode: "run"` unless you are intentionally testing

464-

thread-bound persistent ACP sessions.

465-

- Do not require `streamTo: "parent"` for the basic gate. That path depends on

466-

requester/session capabilities and is a separate integration check.

467-

- Treat thread-bound `mode: "session"` testing as a second, richer integration

468-

pass from a real Discord thread or Telegram topic.

389+

</Accordion>

469390470391

## Sandbox compatibility

471392

@@ -554,30 +475,6 @@ Notes:

554475555476

## ACP controls

556477557-

Available command family:

558-559-

- `/acp spawn`

560-

- `/acp cancel`

561-

- `/acp steer`

562-

- `/acp close`

563-

- `/acp status`

564-

- `/acp set-mode`

565-

- `/acp set`

566-

- `/acp cwd`

567-

- `/acp permissions`

568-

- `/acp timeout`

569-

- `/acp model`

570-

- `/acp reset-options`

571-

- `/acp sessions`

572-

- `/acp doctor`

573-

- `/acp install`

574-575-

`/acp status` shows the effective runtime options and, when available, both runtime-level and backend-level session identifiers.

576-577-

Some controls depend on backend capabilities. If a backend does not support a control, OpenClaw returns a clear unsupported-control error.

578-579-

## ACP command cookbook

580-581478

| Command | What it does | Example |

582479

| -------------------- | --------------------------------------------------------- | ------------------------------------------------------------- |

583480

| `/acp spawn` | Create ACP session; optional current bind or thread bind. | `/acp spawn codex --bind here --cwd /repo` |

@@ -596,7 +493,7 @@ Some controls depend on backend capabilities. If a backend does not support a co

596493

| `/acp doctor` | Backend health, capabilities, actionable fixes. | `/acp doctor` |

597494

| `/acp install` | Print deterministic install and enable steps. | `/acp install` |

598495599-

`/acp sessions` reads the store for the current bound or requester session. Commands that accept `session-key`, `session-id`, or `session-label` tokens resolve targets through gateway session discovery, including custom per-agent `session.store` roots.

496+

`/acp status` shows the effective runtime options plus runtime-level and backend-level session identifiers. Unsupported-control errors surface clearly when a backend lacks a capability. `/acp sessions` reads the store for the current bound or requester session; target tokens (`session-key`, `session-id`, or `session-label`) resolve through gateway session discovery, including custom per-agent `session.store` roots.

600497601498

## Runtime options mapping

602499

@@ -739,16 +636,9 @@ Then verify backend health:

739636740637

### acpx command and version configuration

741638742-

By default, the bundled acpx backend plugin (`acpx`) uses the plugin-local pinned binary:

639+

By default, the bundled `acpx` plugin uses its plugin-local pinned binary (`node_modules/.bin/acpx` inside the plugin package). Startup registers the backend as not-ready and a background job verifies `acpx --version`; if the binary is missing or mismatched, it runs `npm install --omit=dev --no-save acpx@<pinned>` and re-verifies. The gateway stays non-blocking throughout.

743640744-

1. Command defaults to the plugin-local `node_modules/.bin/acpx` inside the ACPX plugin package.

745-

2. Expected version defaults to the extension pin.

746-

3. Startup registers ACP backend immediately as not-ready.

747-

4. A background ensure job verifies `acpx --version`.

748-

5. If the plugin-local binary is missing or mismatched, it runs:

749-

`npm install --omit=dev --no-save acpx@<pinned>` and re-verifies.

750-751-

You can override command/version in plugin config:

641+

Override the command or version in plugin config:

752642753643

```json

754644

{

@@ -766,13 +656,9 @@ You can override command/version in plugin config:

766656

}

767657

```

768658769-

Notes:

770-771-

- `command` accepts an absolute path, relative path, or command name (`acpx`).

772-

- Relative paths resolve from OpenClaw workspace directory.

659+

- `command` accepts an absolute path, relative path (resolved from the OpenClaw workspace), or command name.

773660

- `expectedVersion: "any"` disables strict version matching.

774-

- When `command` points to a custom binary/path, plugin-local auto-install is disabled.

775-

- OpenClaw startup remains non-blocking while the backend health check runs.

661+

- Custom `command` paths disable plugin-local auto-install.

776662777663

See [Plugins](/tools/plugin).

778664