Skip to content

sessions_spawn

用途

创建新的隔离会话,可用于子代理或 ACP harness。

常见参数

参数说明
task要交给新会话的任务说明
runtimesubagentacp
moderunsession
thread是否 thread-bound
agentIdACP/runtime 指定 agent
cwd工作目录
model模型覆盖
timeoutSeconds会话超时
runTimeoutSeconds单次运行超时

请求示例

json
{
  "runtime": "subagent",
  "mode": "run",
  "task": "检查这个项目的 failing tests 并给出修复建议"
}
json
{
  "runtime": "acp",
  "agentId": "codex",
  "mode": "session",
  "thread": true,
  "task": "继续实现这个 PR"
}

返回示例

通常会返回新会话或任务的标识,后续可用于跟踪或通信。

常见误用

  • 小任务也派子代理,徒增复杂度
  • 用户明确要 ACP,却错误走本地 shell

聚焦 OpenClaw、tool_calls、function calling 与 agent 实战。