sessions_spawn
用途
创建新的隔离会话,可用于子代理或 ACP harness。
常见参数
| 参数 | 说明 |
|---|---|
task | 要交给新会话的任务说明 |
runtime | subagent 或 acp |
mode | run 或 session |
thread | 是否 thread-bound |
agentId | ACP/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