Caricamento in corso...
Caricamento in corso...
Last synced: Today, 22:00
Technical reference for the OpenClaw framework. Real-time synchronization with the official documentation engine.
Use this file to discover all available pages before exploring further.
Agent Client Protocol (ACP) sessions let OpenClaw run external coding harnesses (for example Pi, Claude Code, Cursor, Copilot, Droid, OpenClaw ACP, OpenCode, Gemini CLI, and other supported ACPX harnesses) through an ACP backend plugin.
Each ACP session spawn is tracked as a background task.
If you want Codex or Claude Code to connect as an external MCP client
directly to existing OpenClaw channel conversations, use
openclaw mcp serve
| You want to… | Use this | Notes |
|---|---|---|
| Bind or control Codex in the current conversation | text /codex bindtext /codex threads | Native Codex app-server path when the text codex |
| Run Claude Code, Gemini CLI, explicit Codex ACP, or another external harness through OpenClaw | This page | Chat-bound sessions, text /acp spawntext sessions_spawn({ runtime: "acp" }) |
| Expose an OpenClaw Gateway session as an ACP server for an editor or client | text openclaw acp | Bridge mode. IDE/client talks ACP to OpenClaw over stdio/WebSocket |
| Reuse a local AI CLI as a text-only fallback model | CLI Backends | Not ACP. No OpenClaw tools, no ACP controls, no harness runtime |
Usually yes. Fresh installs ship the bundled
acpxacpx/acp doctorOpenClaw only teaches agents about ACP spawning when ACP is truly usable: ACP must be enabled, dispatch must not be disabled, the current session must not be sandbox-blocked, and a runtime backend must be loaded. If those conditions are not met, ACP plugin skills and
sessions_spawnOpenClaw plugin tools and built-in OpenClaw tools are not exposed to ACP harnesses by default. Enable the explicit MCP bridges in ACP agents — setup only when the harness should call those tools directly.
With the bundled
acpx/acp spawn <id>sessions_spawn({ runtime: "acp", agentId: "<id>" })| Harness id | Typical backend | Notes |
|---|---|---|
text claude | Claude Code ACP adapter | Requires Claude Code auth on the host. |
text codex | Codex ACP adapter | Explicit ACP fallback only when native text /codex |
text copilot | GitHub Copilot ACP adapter | Requires Copilot CLI/runtime auth. |
text cursor | Cursor CLI ACP ( text cursor-agent acp | Override the acpx command if a local install exposes a different ACP entrypoint. |
text droid | Factory Droid CLI | Requires Factory/Droid auth or text FACTORY_API_KEY |
text gemini | Gemini CLI ACP adapter | Requires Gemini CLI auth or API key setup. |
text iflow | iFlow CLI | Adapter availability and model control depend on the installed CLI. |
text kilocode | Kilo Code CLI | Adapter availability and model control depend on the installed CLI. |
text kimi | Kimi/Moonshot CLI | Requires Kimi/Moonshot auth on the host. |
text kiro | Kiro CLI | Adapter availability and model control depend on the installed CLI. |
text opencode | OpenCode ACP adapter | Requires OpenCode CLI/provider auth. |
text openclaw | OpenClaw Gateway bridge through text openclaw acp | Lets an ACP-aware harness talk back to an OpenClaw Gateway session. |
text pi | Pi/embedded OpenClaw runtime | Used for OpenClaw-native harness experiments. |
text qwen | Qwen Code / Qwen CLI | Requires Qwen-compatible auth on the host. |
Custom acpx agent aliases can be configured in acpx itself, but OpenClaw policy still checks
acp.allowedAgentsagents.list[].runtime.acp.agentQuick
/acpUse ACP when you want an external harness runtime. Use native Codex app-server for Codex conversation binding/control when the
codex| Area | ACP session | Sub-agent run |
|---|---|---|
| Runtime | ACP backend plugin (for example acpx) | OpenClaw native sub-agent runtime |
| Session key | text agent:<agentId>:acp:<uuid> | text agent:<agentId>:subagent:<uuid> |
| Main commands | text /acp ... | text /subagents ... |
| Spawn tool | text sessions_spawntext runtime:"acp" | text sessions_spawn |
See also Sub-agents.
For Claude Code through ACP, the stack is:
acpxACP Claude is a harness session with ACP controls, session resume, background-task tracking, and optional conversation/thread binding.
CLI backends are separate text-only local fallback runtimes — see CLI Backends.
For operators, the practical rule is:
/acp spawn--thread ...cwd/acp spawn <harness> --bind here/new/reset/acp closeExamples:
text/codex bind # native Codex bind, route future messages here /codex model gpt-5.4 # tune the bound native Codex thread /codex stop # control the active native Codex turn /acp spawn codex --bind here # explicit ACP fallback for Codex /acp spawn codex --thread auto # may create a child thread/topic and bind there /acp spawn codex --bind here --cwd /workspace/repo # same chat binding, Codex runs in /workspace/repo
For non-ephemeral workflows, configure persistent ACP bindings in top-level
bindings[]match.channel="discord"match.peer.id="<channelOrThreadId>"match.channel="telegram"match.peer.id="<chatId>:topic:<topicId>"match.channel="bluebubbles"match.peer.id="<handle|chat_id:*|chat_guid:*|chat_identifier:*>"chat_id:*chat_identifier:*match.channel="imessage"match.peer.id="<handle|chat_id:*|chat_guid:*|chat_identifier:*>"chat_id:*Use
agents.list[].runtimeagents.list[].runtime.type="acp"agents.list[].runtime.acp.agentcodexclaudeagents.list[].runtime.acp.backendagents.list[].runtime.acp.modeagents.list[].runtime.acp.cwdOverride precedence for ACP bound sessions:
bindings[].acp.*agents.list[].runtime.acp.*acp.backendjson5{ agents: { list: [ { id: "codex", runtime: { type: "acp", acp: { agent: "codex", backend: "acpx", mode: "persistent", cwd: "/workspace/openclaw", }, }, }, { id: "claude", runtime: { type: "acp", acp: { agent: "claude", backend: "acpx", mode: "persistent" }, }, }, ], }, bindings: [ { type: "acp", agentId: "codex", match: { channel: "discord", accountId: "default", peer: { kind: "channel", id: "222222222222222222" }, }, acp: { label: "codex-main" }, }, { type: "acp", agentId: "claude", match: { channel: "telegram", accountId: "default", peer: { kind: "group", id: "-1001234567890:topic:42" }, }, acp: { cwd: "/workspace/repo-b" }, }, { type: "route", agentId: "main", match: { channel: "discord", accountId: "default" }, }, { type: "route", agentId: "main", match: { channel: "telegram", accountId: "default" }, }, ], channels: { discord: { guilds: { "111111111111111111": { channels: { "222222222222222222": { requireMention: false }, }, }, }, }, telegram: { groups: { "-1001234567890": { topics: { "42": { requireMention: false } }, }, }, }, }, }
/new/resetcwdTwo ways to start an ACP session:
text```json} { "task": "Open the repo and summarize failing tests", "runtime": "acp", "agentId": "codex", "thread": true, "mode": "session" } ``` <Note> `runtime` defaults to `subagent`, so set `runtime: "acp"` explicitly for ACP sessions. If `agentId` is omitted, OpenClaw uses `acp.defaultAgent` when configured. `mode: "session"` requires `thread: true` to keep a persistent bound conversation. </Note>
text```text} /acp spawn codex --mode persistent --thread auto /acp spawn codex --mode oneshot --thread off /acp spawn codex --bind here /acp spawn codex --thread here ``` Key flags: * `--mode persistent|oneshot` * `--bind here|off` * `--thread auto|here|off` * `--cwd <absolute-path>` * `--label <name>` See [Slash commands](/tools/slash-commands).
sessions_spawntextNotes: * `--bind here` is the simplest operator path for "make this channel or chat Codex-backed." * `--bind here` does not create a child thread. * `--bind here` is only available on channels that expose current-conversation binding support. * `--bind` and `--thread` cannot be combined in the same `/acp spawn` call.
textNotes: * On non-thread binding surfaces, default behavior is effectively `off`. * Thread-bound spawn requires channel policy support: * Discord: `channels.discord.threadBindings.spawnAcpSessions=true` * Telegram: `channels.telegram.threadBindings.spawnAcpSessions=true` * Use `--bind here` when you want to pin the current conversation without creating a child thread.
ACP sessions can be either interactive workspaces or parent-owned background work. The delivery path depends on that shape.
ACP sessions currently run on the host runtime, not inside the OpenClaw sandbox.
cwdruntime: "subagent"Current limitations:
sessions_spawn({ runtime: "acp" })/acp spawnsessions_spawnruntime: "acp"sandbox: "require"Most
/acpsession-keysession-idsession-labelResolution order:
--session/acp steerCurrent-conversation bindings and thread bindings both participate in step 2.
If no target resolves, OpenClaw returns a clear error (
Unable to resolve session target: ...| Command | What it does | Example |
|---|---|---|
text /acp spawn | Create ACP session; optional current bind or thread bind. | text /acp spawn codex --bind here --cwd /repo |
text /acp cancel | Cancel in-flight turn for target session. | text /acp cancel agent:codex:acp:<uuid> |
text /acp steer | Send steer instruction to running session. | text /acp steer --session support inbox prioritize failing tests |
text /acp close | Close session and unbind thread targets. | text /acp close |
text /acp status | Show backend, mode, state, runtime options, capabilities. | text /acp status |
text /acp set-mode | Set runtime mode for target session. | text /acp set-mode plan |
text /acp set | Generic runtime config option write. | text /acp set model openai/gpt-5.4 |
text /acp cwd | Set runtime working directory override. | text /acp cwd /Users/user/Projects/repo |
text /acp permissions | Set approval policy profile. | text /acp permissions strict |
text /acp timeout | Set runtime timeout (seconds). | text /acp timeout 120 |
text /acp model | Set runtime model override. | text /acp model anthropic/claude-opus-4-6 |
text /acp reset-options | Remove session runtime option overrides. | text /acp reset-options |
text /acp sessions | List recent ACP sessions from store. | text /acp sessions |
text /acp doctor | Backend health, capabilities, actionable fixes. | text /acp doctor |
text /acp install | Print deterministic install and enable steps. | text /acp install |
/acp status/acp sessionssession-keysession-idsession-labelsession.store/acp| Command | Maps to | Notes |
|---|---|---|
text /acp model <id> | runtime config key text model | For Codex ACP, OpenClaw normalizes text openai-codex/<model>text openai-codex/gpt-5.4/hightext reasoning_effort |
text /acp set thinking <level> | runtime config key text thinking | For Codex ACP, OpenClaw sends the corresponding text reasoning_effort |
text /acp permissions <profile> | runtime config key text approval_policy | — |
text /acp timeout <seconds> | runtime config key text timeout | — |
text /acp cwd <path> | runtime cwd override | Direct update. |
text /acp set <key> <value> | generic | text key=cwd |
text /acp reset-options | clears all runtime overrides | — |
For acpx harness configuration (Claude Code / Codex / Gemini CLI aliases), the plugin-tools and OpenClaw-tools MCP bridges, and ACP permission modes, see ACP agents — setup.
| Symptom | Likely cause | Fix |
|---|---|---|
text ACP runtime backend is not configured | Backend plugin missing, disabled, or blocked by text plugins.allow | Install and enable backend plugin, include text acpxtext plugins.allowtext /acp doctor |
text ACP is disabled by policy (acp.enabled=false) | ACP globally disabled. | Set text acp.enabled=true |
text ACP dispatch is disabled by policy (acp.dispatch.enabled=false) | Automatic dispatch from normal thread messages disabled. | Set text acp.dispatch.enabled=truetext sessions_spawn({ runtime: "acp" }) |
text ACP agent "<id>" is not allowed by policy | Agent not in allowlist. | Use allowed text agentIdtext acp.allowedAgents |
text /acp doctor | Plugin dependency probe or self-repair is still running. | Wait briefly and rerun text /acp doctor |
| Harness command not found | Adapter CLI is not installed, staged plugin deps are missing, or first-run text npx | Run text /acp doctor |
| Model-not-found from the harness | Model id is valid for another provider/harness but not this ACP target. | Use a model listed by that harness, configure the model in the harness, or omit the override. |
| Vendor auth error from the harness | OpenClaw is healthy, but the target CLI/provider is not logged in. | Log in or provide the required provider key on the Gateway host environment. |
text Unable to resolve session target: ... | Bad key/id/label token. | Run text /acp sessions |
text --bind here requires running /acp spawn inside an active ... conversation | text --bind here | Move to the target chat/channel and retry, or use unbound spawn. |
text Conversation bindings are unavailable for <channel>. | Adapter lacks current-conversation ACP binding capability. | Use text /acp spawn ... --thread ...text bindings[] |
text --thread here requires running /acp spawn inside an active ... thread | text --thread here | Move to target thread or use text --thread autotext off |
text Only <user-id> can rebind this channel/conversation/thread. | Another user owns the active binding target. | Rebind as owner or use a different conversation or thread. |
text Thread bindings are unavailable for <channel>. | Adapter lacks thread binding capability. | Use text --thread off |
text Sandboxed sessions cannot spawn ACP sessions ... | ACP runtime is host-side; requester session is sandboxed. | Use text runtime="subagent" |
text sessions_spawn sandbox="require" is unsupported for runtime="acp" ... | text sandbox="require" | Use text runtime="subagent"text sandbox="inherit" |
text Cannot apply --model ... did not advertise model support | The target harness does not expose generic ACP model switching. | Use a harness that advertises ACP text modelstext session/set_model |
| Missing ACP metadata for bound session | Stale/deleted ACP session metadata. | Recreate with text /acp spawn |
text AcpRuntimeError: Permission prompt unavailable in non-interactive mode | text permissionMode | Set text plugins.entries.acpx.config.permissionModetext approve-all |
| ACP session fails early with little output | Permission prompts are blocked by text permissionModetext nonInteractivePermissions | Check gateway logs for text AcpRuntimeErrortext permissionMode=approve-alltext nonInteractivePermissions=deny |
| ACP session stalls indefinitely after completing work | Harness process finished but ACP session did not report completion. | Monitor with text ps aux | grep acpx |
| Harness sees text <<<BEGIN_OPENCLAW_INTERNAL_CONTEXT>>> | Internal event envelope leaked across the ACP boundary. | Update OpenClaw and rerun the completion flow; external harnesses should receive plain completion prompts only. |
© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine