Skills acp-background-runs
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/ambition0802/acp-background-runs" ~/.claude/skills/openclaw-skills-acp-background-runs && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/ambition0802/acp-background-runs" ~/.openclaw/skills/openclaw-skills-acp-background-runs && rm -rf "$T"
manifest:
skills/ambition0802/acp-background-runs/SKILL.mdsource content
ACP / Codex Background Runs
When a user asks to use ACP or an external coding agent such as Codex, Claude Code, Gemini CLI, or OpenCode, do not execute the task synchronously in the current chat. Route it through the ACP runtime instead.
Default Rules
- Prefer
and setsessions_spawn
with the appropriateruntime: "acp"agentId - Default to
mode: "run" - Only use
orthread: true
when the user explicitly asks for an ongoing interactive or thread-bound sessionmode: "session" - Set
when the target repository or directory is knowncwd - Prefer absolute paths for
; do not passcwd
directly, expand it first~ - Use a relaxed
for longer tasks; do not mechanically default torunTimeoutSeconds300 - Do not wait in the current conversation and do not poll for progress
- Reply immediately after submission that the task has been accepted and is running in the background
- Rely on
completion notifications to send the final result back to the current conversationsessions_spawn - Only add
when the user explicitly asks for progress updatesstreamTo: "parent"
Default Handling
If the user is simply dispatching an ACP / Codex task and does not explicitly request a persistent interactive session, treat it as a one-shot background run. Do not block the current conversation. Send the result back only when the background run completes.
Timeout Guidance
- Quick read-only checks, short analysis, light tasks:
runTimeoutSeconds: 120-300 - Normal coding tasks, project inspection, small scoped edits:
runTimeoutSeconds: 600 - Research, code changes, file generation, test runs, longer reports:
runTimeoutSeconds: 1200 - Clearly long-running tasks: increase further to
as needed1800-3600 - Do not default to
; only use0
when the user explicitly wants no timeout0
mode
/ thread
Decision Rules
modethread- If the user only wants the external agent to finish a task in the background, use
mode: "run" - If the user explicitly wants to continue talking to the same external-agent context afterward, use
thread: true - If the user explicitly asks for a persistent session, thread session, or long-lived context, use both
andthread: truemode: "session" - If there is no explicit need for ongoing interaction, do not open
mode: "session"
cwd
Rules
cwd- If the target repository, project directory, or work directory is known, set
cwd - Prefer absolute paths
- Expand
before passing the path into~sessions_spawn - If the user did not give a directory but the task clearly targets a known repo, resolve the actual path from context before spawning
Fallback When ACP Is Unavailable
- Try
firstruntime: "acp" - Only fall back to
when the ACP targetruntime: "subagent"
is clearly unavailable, unconfigured, or ACP cannot be used in the current environmentagentId - When falling back, tell the user explicitly that the task is being run via
, not a native ACP sessionsubagent - Do not silently fall back
Reply After Submission
Use this short confirmation by default:
Task accepted. It is running in the background and will report back here when complete.
If
streamTo: "parent" is enabled, also say that key progress updates will be streamed back.
Prohibited Actions
- Do not execute external coding-agent tasks synchronously in the current conversation when they should go through ACP
- Do not poll after submission
- Do not call
,sessions_list
, or similar tools to track child-session progresssessions_history - Do not use
or timer-based waiting to fake background orchestrationsleep - Rely on the
completion / announce mechanism for the final resultsessions_spawn
Recommended Parameter Template
{ "task": "<user request>", "runtime": "acp", "agentId": "<codex|claude|gemini|opencode|...>", "mode": "run", "cwd": "/abs/path/if-known", "runTimeoutSeconds": 300 }
When To Adjust
- Need ongoing multi-turn context: add
and, if needed,thread: truemode: "session" - Task may run for many minutes: increase
runTimeoutSeconds - Task is only a quick read-only check: keep
smallrunTimeoutSeconds - User explicitly wants progress relayed back: add
streamTo: "parent" - ACP is unavailable but the task should still run in the background: explain the fallback and use
runtime: "subagent"