* refactor: extract agent core package Introduce packages/agent-core as the OpenClaw-owned home for reusable agent loop, harness, session, prompt, and runtime dependency contracts. * refactor: extract shared llm runtime Move provider model registries, stream wrappers, OAuth helpers, and LLM utilities into src/llm with plugin-sdk barrels instead of depending on the old embedded runtime layout. * refactor: remove pi runtime internals Rename remaining Pi-shaped agent surfaces to OpenClaw agent runtime names, delete obsolete Pi docs and package graph checks, and add the third-party notice for incorporated code. * refactor: tighten agent session runtime Make agent-core/runtime dependencies explicit, consolidate compaction and session transcript helpers, and move model/session helpers behind OpenClaw-owned contracts. * refactor: remove static model and pi auth paths Drop static model catalogs and Pi auth bridges, move model/provider facts to manifest-owned runtime contracts, and harden internal embedded-agent utilities. * refactor: remove legacy provider compat paths * docs: remove agent parity notes * fix: skip provider wildcard metadata parsing * refactor: share session extension sdk loading * refactor: inline acpx proxy error formatter * refactor: fold edit recovery into edit tool * fix: accept extension batch separator * test: align startup provider plugin expectations * fix: restore provider-scoped release discovery * test: align static asset packaging expectations * fix: run static provider catalogs during scoped discovery * fix: add provider entry catalogs for scoped live discovery * fix: load lightweight provider catalog entries * fix: refresh provider-scoped plugin metadata * fix: keep provider catalog entries on release live path * fix: keep static manifest models in release live checks * fix: harden release model discovery * fix: reduce OpenAI live cache probe reasoning * fix: disable OpenAI cache probe reasoning * ci: extend OpenAI gateway live timeout * fix: extend live gateway model budget * fix: stabilize release validation regressions * fix: honor provider aliases in model rows * fix: stabilize release validation lanes * fix: stabilize release memory qa * ci: stabilize release validation lanes * ci: prefer ipv4 for live docker node calls * fix: restore shared tool-call stream wrapper * ci: remove legacy pi test shard alias * fix: clean up embedded agent test drift * fix: stabilize runtime alias status * fix: clean up embedded agent ci drift * fix: restore release ci invariants * fix: clean up post-rebase runtime drift * fix: restore release ci checks * fix: restore release ci after rebase * fix: remove stale pi runtime path * test: align compaction runtime expectations * test: update plugin prerelease expectations * fix: handle claude live tool approvals * fix: stabilize release validation gates * fix: finish agent runtime import * test: finish post-rebase agent runtime mocks * fix: keep codex compaction native * fix: stabilize codex app-server hook tests * test: isolate codex diagnostic active run * test: remove codex diagnostic completion race # Conflicts: # extensions/codex/src/app-server/run-attempt.test.ts * ci: fix full release manifest performance run id * refactor: narrow llm plugin sdk boundary * chore: drop generated google boundary stamps * fix: repair rebase fallout * fix: clean up rebased runtime references * fix: decode codex jwt payloads as base64url * fix: preserve shipped pi runtime alias * fix: add scoped sdk virtual modules * fix: decode llm codex oauth jwt as base64url * fix: avoid stale vertex adc negative cache * fix: harden tool arg decoding and codeql path * fix: keep vertex adc negative checks live * refactor: consolidate codex jwt and edit helpers * fix: await codex oauth node runtime imports * fix: preserve sdk tool and notice contracts * fix: preserve shipped compat config boundaries * fix: align codex oauth callback host * fix: terminate agent-core loop streams on failure * fix: keep codex oauth callback alive during fallback * ci: include session tools in critical codeql scans * fix: keep Cloudflare Anthropic provider auth header * docs: redirect legacy pi runtime pages * fix: honor bundled web provider compat discovery * fix: protect session output spill files * fix: keep legacy agent dir env blocked * fix: contain auto-discovered skill symlinks * fix: harden agent core sdk proxy surfaces * fix: restore approval reaction sdk compat * fix: keep live docker runs bounded * fix: keep codex oauth redirect host aligned * fix: resolve post-rebase agent runtime drift * fix: redact anthropic oauth parse failures * fix: preserve responses strict tool shaping * fix: repair agent runtime rebase cleanup * docs: redirect retired parity pages * fix: bound auto-discovered resources to roots * fix: repair post-rebase agent test drift * fix: preserve bundled provider allowlist migration * fix: preserve manifest-owned provider aliases * fix: declare photon image dependency * fix: keep provider headers out of proxy body * fix: preserve shipped env aliases * fix: refresh control ui i18n generated state * fix: quote read fallback paths * fix: preview edits through configured backend * test: satisfy core test typecheck * fix: preserve ZAI usage auth fallback * test: repair codex diagnostic test * fix: repair agent runtime rebase drift * test: finish embedded runner import rename * fix: repair agent runtime rebase integrations * test: align compaction oauth fallback expectations * fix: allow sdk-auth session models * fix: update doctor tool schema import * fix: preserve bedrock plugin region * fix: stream harmony-like prose immediately * ci: include session runtime in codeql shards * fix: repair latest rebase integrations * fix: honor explicit codex websocket transport * fix: keep openai-compatible credentials provider-scoped * fix: refresh sdk api baseline after rebase * fix: route cli runtime aliases through openclaw harness * test: rename stale harness mock expectation * test: rename embedded agent overflow calls * test: clean embedded auth test wording * test: use openclaw stream types in deepinfra cache test * fix: refresh sdk api baseline on latest main * fix: honor bundled discovery compat allowlists * fix: refresh sdk api baseline after latest rebase * fix: remove stale rebase imports * test: rename stale model catalog mock * test: mock renamed doctor runtime modules * fix: map canonical kimi env auth * fix: use internal model registry in bench script * fix: migrate deepinfra provider catalog entry * fix: enforce builtin tool suppression * fix: route compaction auth and proxy payloads safely * refactor: prune unused llm registry leftovers * test: update codex hooks session import * test: fix model picker ci coverage * test: align model picker auth mock types
9.2 KiB
name, description, user-invocable
| name | description | user-invocable |
|---|---|---|
| acp-router | Route plain-language requests for Claude Code, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, Qwen, Kiro, Kimi, iFlow, Factory Droid, Kilocode, or explicit ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-driven sessions ("telephone game" flow). For coding-agent thread requests, read this skill first, then use only `sessions_spawn` for thread creation. Codex chat binding defaults to the native Codex app-server plugin unless ACP is explicit or background spawn needs ACP. | false |
ACP Harness Router
When user intent is "run this in Claude Code/Cursor/Copilot/OpenClaw/OpenCode/Gemini/Qwen/Kiro/Kimi/iFlow/Droid/Kilocode (ACP harness)", do not use subagent runtime or PTY scraping. Route through ACP-aware flows.
Codex is special: plain chat/conversation binding and control should use the native Codex app-server plugin (/codex bind, /codex threads, /codex resume) instead of the default ACP path. Use ACP for Codex only when the user explicitly names ACP//acp/acpx, or when spawning background child sessions through sessions_spawn where a native Codex runtime spawn is not available yet.
Intent detection
Trigger this skill when the user asks OpenClaw to:
- run something in Claude Code / Cursor / Copilot / OpenClaw / OpenCode / Gemini / Qwen / Kiro / Kimi / iFlow / Droid / Kilocode
- run Codex explicitly through ACP,
/acp, or acpx - continue existing harness work
- relay instructions to an external coding harness
- keep an external harness conversation in a thread-like conversation
Mandatory preflight for coding-agent thread requests:
- Before creating any thread for ACP harness work, read this skill first in the same turn.
- After reading, follow
OpenClaw ACP runtime pathbelow; do not usemessage(action="thread-create")for ACP harness thread spawn.
Mode selection
Choose one of these paths:
- OpenClaw ACP runtime path (default): use
sessions_spawn/ ACP runtime tools. - Direct
acpxpath (telephone game): useacpxCLI throughexecto drive the harness session directly.
Use direct acpx when one of these is true:
- user explicitly asks for direct
acpxdriving - ACP runtime/plugin path is unavailable or unhealthy
- the task is "just relay prompts to harness" and no OpenClaw ACP lifecycle features are needed
Do not use:
subagentsruntime for harness control/acpcommand delegation as a requirement for the user- PTY scraping of supported ACP harness CLIs when
acpxis available
AgentId mapping
Use these defaults when user names a harness directly:
- "openclaw" ->
agentId: "openclaw" - "claude" or "claude code" ->
agentId: "claude" - "codex" ->
agentId: "codex"only for explicit ACP/acpx requests or background ACP runtime spawn - "copilot" or "github copilot" ->
agentId: "copilot" - "cursor" or "cursor cli" ->
agentId: "cursor" - "droid" or "factory droid" ->
agentId: "droid" - "opencode" ->
agentId: "opencode" - "gemini" or "gemini cli" ->
agentId: "gemini" - "iflow" ->
agentId: "iflow" - "kilocode" ->
agentId: "kilocode" - "kimi" or "kimi cli" ->
agentId: "kimi" - "kiro" or "kiro cli" ->
agentId: "kiro" - "qwen" or "qwen code" ->
agentId: "qwen"
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.
OpenClaw ACP runtime path
Required behavior:
- For ACP harness thread spawn requests, read this skill first in the same turn before calling tools.
- Use
sessions_spawnwith:runtime: "acp"thread: truemode: "session"(unless user explicitly wants one-shot)
- For ACP harness thread creation, do not use
messagewithaction=thread-create;sessions_spawnis the only thread-create path. - Put requested work in
taskso the ACP session gets it immediately. - Set
agentIdexplicitly unless ACP default agent is known. - Do not ask user to run slash commands or CLI when this path works directly.
Example:
User: "spawn a test codex ACP session in thread and tell it to say hi"
Call:
{
"task": "Say hi.",
"runtime": "acp",
"agentId": "codex",
"thread": true,
"mode": "session"
}
Thread spawn recovery policy
When the user asks to start a coding harness in a thread, treat that as an ACP runtime request and try to satisfy it end-to-end.
Required behavior when ACP backend is unavailable:
- Do not immediately ask the user to pick an alternate path.
- First attempt automatic local repair:
- ensure plugin-local pinned acpx is installed in the ACPX plugin package
- verify
${ACPX_CMD} --version
- After reinstall/repair, restart the gateway and explicitly offer to run that restart for the user.
- Retry ACP thread spawn once after repair.
- Only if repair+retry fails, report the concrete error and then offer fallback options.
When offering fallback, keep ACP first:
- Option 1: retry ACP spawn after showing exact failing step
- Option 2: direct acpx telephone-game flow
Do not default to subagent runtime for these requests.
ACPX install and version policy (direct acpx path)
For this repo, direct acpx calls must follow the same pinned policy as the @openclaw/acpx extension package.
- Prefer plugin-local binary, not global PATH:
${ACPX_PLUGIN_ROOT}/node_modules/.bin/acpx
- Resolve pinned version from extension dependency:
node -e "console.log(require(process.env.ACPX_PLUGIN_ROOT + '/package.json').dependencies.acpx)"
- If binary is missing or version mismatched, install plugin-local pinned version:
cd "$ACPX_PLUGIN_ROOT" && npm install --omit=dev --no-save acpx@<pinnedVersion>
- Verify before use:
${ACPX_PLUGIN_ROOT}/node_modules/.bin/acpx --version
- If install/repair changed ACPX artifacts, restart the gateway and offer to run the restart.
- Do not run
npm install -g acpxunless the user explicitly asks for global install.
Set and reuse:
ACPX_PLUGIN_ROOT="<bundled-acpx-plugin-root>"
ACPX_CMD="$ACPX_PLUGIN_ROOT/node_modules/.bin/acpx"
Direct acpx path ("telephone game")
Use this path to drive harness sessions without /acp or subagent runtime.
Rules
- Use
execcommands that call${ACPX_CMD}. - Reuse a stable session name per conversation so follow-up prompts stay in the same harness context.
- Prefer
--format quietfor clean assistant text to relay back to user. - Use
exec(one-shot) only when the user wants one-shot behavior. - Keep working directory explicit (
--cwd) when task scope depends on repo context.
Session naming
Use a deterministic name, for example:
oc-<harness>-<conversationId>
Where conversationId is thread id when available, otherwise channel/conversation id.
Command templates
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>
Harness aliases in acpx
claudecodexcopilotcursordroidgeminiiflowkilocodekimikiroopenclawopencodeqwen
Built-in adapter commands in acpx
Defaults are:
openclaw -> openclaw acpclaude -> bundled @agentclientprotocol/claude-agent-acp@0.32.0codex -> bundled @zed-industries/codex-acp@0.13.0 through OpenClaw's isolated CODEX_HOME wrappercopilot -> copilot --acp --stdiocursor -> cursor-agent acpdroid -> droid exec --output-format acpgemini -> gemini --acpiflow -> iflow --experimental-acpkilocode -> npx -y @kilocode/cli acpkimi -> kimi acpkiro -> kiro-cli acpopencode -> npx -y opencode-ai acpqwen -> qwen --acp
If ~/.acpx/config.json overrides agents, those overrides replace defaults.
If your local Cursor install still exposes ACP as agent acp, set that as the cursor agent override explicitly.
Failure handling
acpx: command not found:- for thread-spawn ACP requests, install plugin-local pinned acpx in the ACPX plugin package 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
acpxunless explicitly requested
- adapter command missing (for example
claude-agent-acpnot found):- for thread-spawn ACP requests, first restore built-in defaults by removing broken
~/.acpx/config.jsonagent overrides - then retry once before offering fallback
- if user wants binary-based overrides, install exactly the configured adapter binary
- for thread-spawn ACP requests, first restore built-in defaults by removing broken
NO_SESSION: run${ACPX_CMD} <agent> sessions new --name <sessionName>then retry prompt.- queue busy: either wait for completion (default) or use
--no-waitwhen async behavior is explicitly desired.
Output relay
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.