Files
deepseek-harness/packages/subagent/README.zh.md
Dudu-0223 99a778d63f feat(subagent): continuable background subagents
Implement the continuable background subagents RFC: a durable child
session with a series of Task-backed activations, each disposing its
run before the Task settles.

- dsh-subagent: rename SubagentRun.sendMessage to strict steer, drop
  run-level resume, add SubagentProvider.resume dispatch via
  SubagentService.resume, the continuation start field, and the
  versioned model-hidden subagent/descriptor session event.
- dsh-subagent-inprocess/-spawn/-fork: publish the control-allocated
  child id, append the descriptor inside the initial turn, implement
  cold resume from the child's own transcript under the live parent
  scope, and strict running-only steer.
- dsh-subagent-control (new): SubagentControlService owning stable
  child ids, descriptor snapshot/fold/authorization, Task-backed
  activation with settle-then-dispose ordering, the process-local
  active-run association, and steer-or-resume sendMessage routing.
- dsh-tool-subagent: background route branches on the provider's
  resume capability (continuable via the control service; one-shot
  task for ACP), returning both child and task ids.
- dsh-tool-subagent-control (new): the globally named send_message
  tool rendering steered/started routes.

Keyless coverage spans Task ownership and disposal ordering, running
delivery, cold follow-up, descriptor rejection and rollback, known-id
reconstruction, kill during lookup, admission races, and a new
subagent-continuable ACP snapshot scenario.
2026-08-02 04:34:15 +08:00

3.0 KiB
Raw Blame History

subagent/subagent 能力家族

English | 中文

subagent子 agentseam 允许 agent智能体把工作委派给子 agent。与 bashllm 能力家族一样,这也是一种能力 seam能力 seam),但有一个关键差异:多个提供方实现在同一上下文中共存,并按名称注册,而不是采用 bash 的单实现形态。该注册表仿照大语言模型LLM适配器注册表。

package 角色 ctx 键
subagent/ 抽象 subagent seam具名提供方注册表、词汇与持久化子 agent 描述符 ctx.subagents
subagent-inprocess/ 共享进程内运行驱动器(不含提供方;每次运行使用一个清理 effect
subagent-spawn/ 进程内后端:支持冷恢复的全新子 agent (注册到 ctx.subagents
subagent-fork/ 进程内后端:以父 agent 已完成轮次的前缀作为初始内容、支持冷恢复的子 agent (注册到 ctx.subagents
subagent-acp/ 进程外后端:在 spawn 的子进程中运行并通过 ACPAgent Client Protocol驱动的一次性子 agent (注册到 ctx.subagents
subagent-dsh-sdk/ 进程外后端:在 spawn 的子进程中运行的子 harness 运行时,经 TypeScript SDK 客户端走 stdio JSON-RPC 驱动 (注册到 ctx.subagents
subagent-control/ 可继续子 agent 编排:稳定 ID、描述符查找、由 Task 支撑的 activation以及 steer 或恢复路由 ctx.subagentControl
tool-subagent/ 面向模型的 subagent 委派工具,基于 ctx.subagents (注册到 ctx.tools
tool-subagent-control/ 基于 ctx.subagentControl、全局名称唯一的 send_message 后续消息工具 (注册到 ctx.tools

接口位于 subagent/subagent/。进程内 subagent-spawn / subagent-fork 后端共享 subagent-inprocess 驱动器(一个自身不含提供方的库:两者都依赖它,彼此不依赖),进程外 subagent-acp / subagent-dsh-sdk 后端则经由 subprocess/ seam spawn 其子进程共享的凭据清除、以进程树为范围的拆卸、dispose资源释放阶梯subagent-control 位于该 seam 之上:它把一个持久化子会话绑定到一系列可 dispose、由 Task 支撑的 activation模型工具和面向人的适配器都通过这份统一契约进行路由。测试只用包内 fixture测试前置数据替换子 agent 边界。

提案与设计理由见 .agents/notes/implemented/feature/2026-06-21-subagent-capability-seam.md.agents/notes/implemented/feature/2026-07-21-continuable-background-subagents.md