
























@@ -1,5 +1,5 @@
11---
2-summary: "Use ACP runtime sessions for Codex, Claude Code, Cursor, Gemini CLI, OpenClaw ACP, and other harness agents"
2+summary: "Use ACP runtime sessions for Claude Code, Cursor, Gemini CLI, explicit Codex ACP fallback, OpenClaw ACP, and other harness agents"
33read_when:
44 - Running coding harnesses through ACP
55 - Setting up conversation-bound ACP sessions on messaging channels
@@ -10,9 +10,11 @@ read_when:
1010title: "ACP agents"
1111---
121213-[Agent Client Protocol (ACP)](https://agentclientprotocol.com/) sessions let OpenClaw run external coding harnesses (for example Pi, Claude Code, Codex, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, and other supported ACPX harnesses) through an ACP backend plugin.
13+[Agent Client Protocol (ACP)](https://agentclientprotocol.com/) sessions let OpenClaw run external coding harnesses (for example Pi, Claude Code, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, and other supported ACPX harnesses) through an ACP backend plugin.
141415-If you ask OpenClaw in plain language to "run this in Codex" or "start Claude Code in a thread", OpenClaw should route that request to the ACP runtime (not the native sub-agent runtime). Each ACP session spawn is tracked as a [background task](/automation/tasks).
15+If you ask OpenClaw in plain language to bind or control Codex in the current conversation, OpenClaw should use the native Codex app-server plugin (`/codex bind`, `/codex threads`, `/codex resume`). If you ask for `/acp`, ACP, acpx, or a Codex background child session, OpenClaw can still route Codex through ACP. Each ACP session spawn is tracked as a [background task](/automation/tasks).
16+17+If you ask OpenClaw in plain language to "start Claude Code in a thread" or use another external harness, OpenClaw should route that request to the ACP runtime (not the native sub-agent runtime).
16181719If you want Codex or Claude Code to connect as an external MCP client directly
1820to existing OpenClaw channel conversations, use [`openclaw mcp serve`](/cli/mcp)
@@ -22,11 +24,12 @@ instead of ACP.
22242325There are three nearby surfaces that are easy to confuse:
242625-| You want to... | Use this | Notes |
26-| ---------------------------------------------------------------------------------- | ------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
27-| Run Codex, Claude Code, Gemini CLI, or another external harness _through_ OpenClaw | This page: ACP agents | Chat-bound sessions, `/acp spawn`, `sessions_spawn({ runtime: "acp" })`, background tasks, runtime controls |
28-| Expose an OpenClaw Gateway session _as_ an ACP server for an editor or client | [`openclaw acp`](/cli/acp) | Bridge mode. IDE/client talks ACP to OpenClaw over stdio/WebSocket |
29-| Reuse a local AI CLI as a text-only fallback model | [CLI Backends](/gateway/cli-backends) | Not ACP. No OpenClaw tools, no ACP controls, no harness runtime |
27+| You want to... | Use this | Notes |
28+| ----------------------------------------------------------------------------------------------- | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
29+| Bind or control Codex in the current conversation | `/codex bind`, `/codex threads` | Native Codex app-server path; includes bound chat replies, image forwarding, model/fast/permissions, stop, and steer controls. ACP is an explicit fallback |
30+| Run Claude Code, Gemini CLI, explicit Codex ACP, or another external harness _through_ OpenClaw | This page: ACP agents | Chat-bound sessions, `/acp spawn`, `sessions_spawn({ runtime: "acp" })`, background tasks, runtime controls |
31+| Expose an OpenClaw Gateway session _as_ an ACP server for an editor or client | [`openclaw acp`](/cli/acp) | Bridge mode. IDE/client talks ACP to OpenClaw over stdio/WebSocket |
32+| Reuse a local AI CLI as a text-only fallback model | [CLI Backends](/gateway/cli-backends) | Not ACP. No OpenClaw tools, no ACP controls, no harness runtime |
30333134## Does this work out of the box?
3235@@ -42,25 +45,32 @@ First-run gotchas:
42454346Quick `/acp` flow from chat:
444745-1. **Spawn** — `/acp spawn codex --bind here` or `/acp spawn codex --mode persistent --thread auto`
48+1. **Spawn** — `/acp spawn claude --bind here`, `/acp spawn gemini --mode persistent --thread auto`, or explicit `/acp spawn codex --bind here`
46492. **Work** in the bound conversation or thread (or target the session key explicitly).
47503. **Check state** — `/acp status`
48514. **Tune** — `/acp model <provider/model>`, `/acp permissions <profile>`, `/acp timeout <seconds>`
49525. **Steer** without replacing context — `/acp steer tighten logging and continue`
50536. **Stop** — `/acp cancel` (current turn) or `/acp close` (session + bindings)
515452-Natural-language triggers that should route to the ACP runtime:
55+Natural-language triggers that should route to the native Codex plugin:
53565457- "Bind this Discord channel to Codex."
55-- "Start a persistent Codex session in a thread here."
58+- "Attach this chat to Codex thread `<id>`."
59+- "Show Codex threads, then bind this one."
60+61+Native Codex conversation binding is the default chat-control path, but it is intentionally conservative for interactive Codex approval/tool flows: OpenClaw dynamic tools and approval prompts are not exposed through this bound-chat path yet, so those requests are declined with a clear explanation. Use the Codex harness path or explicit ACP fallback when the workflow depends on OpenClaw dynamic tools or long-running interactive approvals.
62+63+Natural-language triggers that should route to the ACP runtime:
64+5665- "Run this as a one-shot Claude Code ACP session and summarize the result."
5766- "Use Gemini CLI for this task in a thread, then keep follow-ups in that same thread."
67+- "Run Codex through ACP in a background thread."
586859-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.
69+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. Codex only follows this path when ACP is explicit or the requested background runtime still needs ACP.
60706171## ACP versus sub-agents
627263-Use ACP when you want an external harness runtime. Use sub-agents when you want OpenClaw-native delegated runs.
73+Use ACP when you want an external harness runtime. Use native Codex app-server for Codex conversation binding/control. Use sub-agents when you want OpenClaw-native delegated runs.
64746575| Area | ACP session | Sub-agent run |
6676| ------------- | ------------------------------------- | ---------------------------------- |
@@ -105,7 +115,10 @@ Mental model:
105115106116Examples:
107117108-- `/acp spawn codex --bind here` — keep this chat, spawn or attach Codex, route future messages here.
118+- `/codex bind` — keep this chat, spawn or attach native Codex app-server, route future messages here.
119+- `/codex model gpt-5.4`, `/codex fast on`, `/codex permissions yolo` — tune the bound native Codex thread from chat.
120+- `/codex stop` or `/codex steer focus on the failing tests first` — control the active native Codex turn.
121+- `/acp spawn codex --bind here` — explicit ACP fallback for Codex.
109122- `/acp spawn codex --thread auto` — OpenClaw may create a child thread/topic and bind there.
110123- `/acp spawn codex --bind here --cwd /workspace/repo` — same chat binding, Codex runs in `/workspace/repo`.
111124此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。