diff --git a/CHANGELOG.md b/CHANGELOG.md index 57eb035549d..2d9d8fee321 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -87,6 +87,7 @@ Docs: https://docs.openclaw.ai ### Fixes +- ACP/Harness thread spawn routing: force ACP harness thread creation through `sessions_spawn` (`runtime: "acp"`, `thread: true`) and explicitly forbid `message action=thread-create` for ACP harness requests, avoiding misrouted `Unknown channel` errors. (#30957) Thanks @dutifulbob. - CLI/Startup (Raspberry Pi + small hosts): speed up startup by avoiding unnecessary plugin preload on fast routes, adding root `--version` fast-path bootstrap bypass, parallelizing status JSON/non-JSON scans where safe, and enabling Node compile cache at startup with env override compatibility (`NODE_COMPILE_CACHE`, `NODE_DISABLE_COMPILE_CACHE`). (#5871) Thanks @BookCatKid and @vincentkoc for raising startup reports, and @lupuletic for related startup work in #27973. - Telegram/Outbound API proxy env: keep the Node 22 `autoSelectFamily` global-dispatcher workaround while restoring env-proxy support by using `EnvHttpProxyAgent` so `HTTP_PROXY`/`HTTPS_PROXY` continue to apply to outbound requests. (#26207) Thanks @qsysbio-cjw for reporting and @rylena and @vincentkoc for work. - Browser/Security: fail closed on browser-control auth bootstrap errors; if auto-auth setup fails and no explicit token/password exists, browser control server startup now aborts instead of starting unauthenticated. This ships in the next npm release. Thanks @ijxpwastaken. diff --git a/extensions/acpx/skills/acp-router/SKILL.md b/extensions/acpx/skills/acp-router/SKILL.md index c80978fa8ae..a299c9e0229 100644 --- a/extensions/acpx/skills/acp-router/SKILL.md +++ b/extensions/acpx/skills/acp-router/SKILL.md @@ -1,6 +1,6 @@ --- name: acp-router -description: Route plain-language requests for Pi, Claude Code, Codex, OpenCode, Gemini CLI, or ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-driven sessions ("telephone game" flow). +description: Route plain-language requests for Pi, Claude Code, Codex, OpenCode, Gemini CLI, or 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. user-invocable: false --- @@ -17,6 +17,11 @@ Trigger this skill when the user asks OpenClaw to: - 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 Pi/Claude/Codex/OpenCode/Gemini work, read this skill first in the same turn. +- After reading, follow `OpenClaw ACP runtime path` below; do not use `message(action="thread-create")` for ACP harness thread spawn. + ## Mode selection Choose one of these paths: @@ -54,13 +59,15 @@ If policy rejects the chosen id, report the policy error clearly and ask for the Required behavior: -1. Use `sessions_spawn` with: +1. For ACP harness thread spawn requests, read this skill first in the same turn before calling tools. +2. Use `sessions_spawn` with: - `runtime: "acp"` - `thread: true` - `mode: "session"` (unless user explicitly wants one-shot) -2. Put requested work in `task` so the ACP session gets it immediately. -3. Set `agentId` explicitly unless ACP default agent is known. -4. Do not ask user to run slash commands or CLI when this path works directly. +3. For ACP harness thread creation, do not use `message` with `action=thread-create`; `sessions_spawn` is the only thread-create path. +4. Put requested work in `task` so the ACP session gets it immediately. +5. Set `agentId` explicitly unless ACP default agent is known. +6. Do not ask user to run slash commands or CLI when this path works directly. Example: diff --git a/src/agents/system-prompt.test.ts b/src/agents/system-prompt.test.ts index 01cdfb2cc3a..1680b1b3c6a 100644 --- a/src/agents/system-prompt.test.ts +++ b/src/agents/system-prompt.test.ts @@ -266,6 +266,9 @@ describe("buildAgentSystemPrompt", () => { expect(prompt).toContain( "do not route ACP harness requests through `subagents`/`agents_list` or local PTY exec flows", ); + expect(prompt).toContain( + 'do not call `message` with `action=thread-create`; use `sessions_spawn` (`runtime: "acp"`, `thread: true`) as the single thread creation path', + ); }); it("omits ACP harness guidance when ACP is disabled", () => { diff --git a/src/agents/system-prompt.ts b/src/agents/system-prompt.ts index 3b3453be6f7..62b50c32089 100644 --- a/src/agents/system-prompt.ts +++ b/src/agents/system-prompt.ts @@ -449,6 +449,7 @@ export function buildAgentSystemPrompt(params: { 'For requests like "do this in codex/claude code/gemini", treat it as ACP harness intent and call `sessions_spawn` with `runtime: "acp"`.', 'On Discord, default ACP harness requests to thread-bound persistent sessions (`thread: true`, `mode: "session"`) unless the user asks otherwise.', "Set `agentId` explicitly unless `acp.defaultAgent` is configured, and do not route ACP harness requests through `subagents`/`agents_list` or local PTY exec flows.", + 'For ACP harness thread spawns, do not call `message` with `action=thread-create`; use `sessions_spawn` (`runtime: "acp"`, `thread: true`) as the single thread creation path.', ] : []), "Do not poll `subagents list` / `sessions_list` in a loop; only check status on-demand (for intervention, debugging, or when explicitly asked).",