agent_invoke
Invoke any registered agent by name to run a task, with automatic retries and session resumption for long-running jobs.
Instructions
Invoke any registered agent by name to run a task. Generic path over the Agent Registry — same driver as the run_* tools but name-driven, so new agents (e.g. qwen) need no per-agent tool. Non-blocking. Auto-tracks task. Pass session_id to resume a prior session (the captured id is returned for reuse). auto is honored by agents that support it (codex, qwen); others ignore it. Use agent_list to see available names. Retries automatically on 429/rate-limit/timeout with exponential backoff (default 2 retries, 3 total attempts); set max_retries=0 to disable. 【后台契约】调用可立即返回/被调用方撤回:server 端 Promise 不会因调用方撤回而终止,worker 继续在后台跑到完成,结果落 task.result(及 trace,若 capture_trace);调用方随时可用返回的 task_id 经 task_list 或面板 /api/state 取最终产物,无需阻塞等本次调用返回。给长任务(评估/设计/重构, prompt>2000字)显式传 timeout_sec 600~900 防误杀;传 plan_mode 只读调研不落盘。【默认worker】name 可选:省略 或 指定==控制主控(BRIDGE_CONTROLLER) 时,改从空闲 worker 池轮询派一个(排主控,不压 main;全忙回退主控/或 qwen),返回文案标注实际 worker。【备路】name 明确且该 worker 已忙(agent_live busy/有 running 任务)时自动改派空闲备路 worker(排控制主控,不压 main),返回文案标注改派;same_worker:true 强制精确同名、auto_fallback:false 关备路。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| auto | No | ||
| name | No | agent_invoke 默认worker:可选,省略或==BRIDGE_CONTROLLER 时从空闲 worker 池轮询派一个(排主控)而非固定压主控 | |
| model | No | ||
| prompt | Yes | ||
| task_id | No | ||
| workdir | No | ||
| plan_mode | No | Plan 模式:只读调研,强制关 auto,产出方案不落盘 | |
| session_id | No | ||
| max_retries | No | ||
| same_worker | No | agent_invoke 备路:true 强制精确同名,不自动改派 | |
| timeout_sec | No | ||
| fork_on_fail | No | A 失败自动 fork:真失败时父 superseded + 生成备选子任务给此 agent 承接(仅工作流任务,≤3 上限)。不传不自动 fork。 | |
| retry_max_ms | No | ||
| auto_approval | No | 成功时对产物跑 blocklist 硬扫,命中即自动放行被拒(auto_refused)。默认关。 | |
| auto_fallback | No | agent_invoke 备路:false 关闭忙时自动改派 | |
| capture_trace | No | 捕获完整推理 step 流存 task.trace,默认 false | |
| retry_base_ms | No |