When user intent is "run this in Pi/Claude Code/Codex/OpenCode/Gemini/Kimi (ACP harness)", do not use subagent runtime or PTY scraping. Route through ACP-aware flows.
Trigger this skill when the user asks OpenClaw to:
Mandatory preflight for coding-agent thread requests:
OpenClaw ACP runtime path below; do not use message(action="thread-create") for ACP harness thread spawn.Choose one of these paths:
sessions_spawn / ACP runtime tools.acpx path (telephone game): use acpx CLI through exec to drive the harness session directly.Use direct acpx when one of these is true:
acpx drivingDo not use:
subagents runtime for harness control/acp command delegation as a requirement for the useracpx is availableUse these defaults when user names a harness directly:
agentId: "pi"agentId: "claude"agentId: "codex"agentId: "opencode"agentId: "gemini"agentId: "kimi"These defaults match current acpx built-in aliases.
If policy rejects the chosen id, report the policy error clearly and ask for the allowed ACP agent id.
Required behavior:
sessions_spawn with:runtime: "acp"
- thread: true
- mode: "session" (unless user explicitly wants one-shot)
message with action=thread-create; sessions_spawn is the only thread-create path.task so the ACP session gets it immediately.agentId explicitly unless ACP default agent is known.Example:
User: "spawn a test codex session in thread and tell it to say hi"
Call:
{
"task": "Say hi.",
"runtime": "acp",
"agentId": "codex",
"thread": true,
"mode": "session"
}
When the user asks to start a coding harness in a thread (for example "start a codex/claude/pi/kimi thread"), treat that as an ACP runtime request and try to satisfy it end-to-end.
Required behavior when ACP backend is unavailable:
extensions/acpx
- verify ${ACPX_CMD} --version
When offering fallback, keep ACP first:
Do not default to subagent runtime for these requests.
For this repo, direct acpx calls must follow the same pinned policy as the @openclaw/acpx extension.
./extensions/acpx/node_modules/.bin/acpx
node -e "console.log(require('./extensions/acpx/package.json').dependencies.acpx)"
cd extensions/acpx && npm install --omit=dev --no-save acpx@
./extensions/acpx/node_modules/.bin/acpx --version
npm install -g acpx unless the user explicitly asks for global install.Set and reuse:
ACPX_CMD="./extensions/acpx/node_modules/.bin/acpx"
Use this path to drive harness sessions without /acp or subagent runtime.
exec commands that call ${ACPX_CMD}.--format quiet for clean assistant text to relay back to user.exec (one-shot) only when the user wants one-shot behavior.--cwd) when task scope depends on repo context.Use a deterministic name, for example:
oc-- Where conversationId is thread id when available, otherwise channel/conversation id.
Persistent session (create if missing, then prompt):
${ACPX_CMD} codex sessions show oc-codex-<conversationId> \
|| ${ACPX_CMD} codex sessions new --name oc-codex-<conversationId>
${ACPX_CMD} codex -s oc-codex-<conversationId> --cwd <workspacePath> --format quiet "<prompt>"
One-shot:
${ACPX_CMD} codex exec --cwd <workspacePath> --format quiet "<prompt>"
Cancel in-flight turn:
${ACPX_CMD} codex cancel -s oc-codex-<conversationId>
Close session:
${ACPX_CMD} codex sessions close oc-codex-<conversationId>
piclaudecodexopencodegeminikimiDefaults are:
pi -> npx pi-acpclaude -> npx -y @zed-industries/claude-agent-acpcodex -> npx @zed-industries/codex-acpopencode -> npx -y opencode-ai acpgemini -> geminikimi -> kimi acpIf ~/.acpx/config.json overrides agents, those overrides replace defaults.
acpx: command not found:extensions/acpx immediately
- restart gateway after install and offer to run the restart automatically
- then retry once
- do not ask for install permission first unless policy explicitly requires it
- do not install global acpx unless explicitly requested
claude-agent-acp not found):~/.acpx/config.json agent overrides
- then retry once before offering fallback
- if user wants binary-based overrides, install exactly the configured adapter binary
NO_SESSION: run ${ACPX_CMD} sessions new --name then retry prompt.--no-wait when async behavior is explicitly desired.When relaying to user, return the final assistant text output from acpx command result. Avoid relaying raw local tool noise unless user asked for verbose logs.