同步互调(
@Agent、ask_agentsync)见 agent-call-agent.md。
架构说明见 agent-interop-mailbox.md。
- 主 Agent 调用
ask_agent(mode=background),harnessTeamManager将任务入队并立即返回job_id。 - 主对话继续;inbox worker 串行执行:
target.call→ 合成提示 →source.call(落在父thread_id)。 - 完成后
GlobalProcessor.on_reply:Dashboard 仅increment_unread(回复已在 checkpoint);IM 通道则Gateway.push_text。
ask_agent mode |
行为 |
|---|---|
sync(默认) |
阻塞等待子 Agent 一次性 call 结果 |
background |
入 harness inbox,完成后主动通知 |
可选 user_question:写入 inbox 消息,供 compose_followup 使用。
| 路径 | 职责 |
|---|---|
infra/gateway/processor.py |
GlobalProcessor 实现 TeamProcessor(compose_followup / on_reply) |
infra/agents/manager.py |
注册 team_tools()、apply_mentions 薄封装 |
已移除:agent_delegations 表、DelegationRepo、/delegate slash(状态由 harness inbox 内存队列管理)。
当前闭环已可用。可选增强(非阻塞):
- 前端:用户停留在当前 thread 时,除未读角标外主动
loadHistory(或 SSE/WS 通知)。 - harness:inbox
cancel(job_id)暴露给 slash 或管理 API(若需要取消长任务)。 - 重启后 in-flight 任务丢失(inbox 纯内存)——若需持久化队列,应在 harness 层扩展,而非 octop DB 重复实现。