Files
deepseek-harness/packages/subagent
Tianyi Cui 9c1048f2b5 Honor an already-aborted request signal in the subagent driver (Codex review round 2)
A request signal aborted BEFORE the run starts never fires an `abort` event
(`addEventListener` only fires on the transition), so the backend-level bridge
missed it and ran the child to `completed`. The driver now checks
`request.signal?.aborted` at the top of the result path and settles `aborted`
without running the child. Regression test proven red on the pre-fix code.

Also refresh two stale RFC prose blocks the round-1 fix left behind: the
subagent RFC's Problem statement (cited the removed `TODO(sub-agents)` markers
and claimed nothing existed yet) and the unify-id RFC's fork/spawn risk bullet
(described the seam as "explicitly deferred" via `AgentLoop.create`'s old TODO),
now pointing at the realized seam.
2026-06-22 07:32:09 +08:00
..

subagent/ — subagent capability family

The subagent seam: an agent delegating work to a child agent. Like the bash and llm families this is a capability seam (see capability seams) — but with one defining difference: multiple provider implementations coexist in one context, registered by name, rather than the single-implementation bash shape. The registry mirrors the LLM adapter registry.

Package Role ctx key
subagent/ Abstract subagent seam: named-provider registry + vocabulary ctx.subagents
subagent-spawn/ In-process backend: a fresh child agent (+ the shared run driver) (registers on ctx.subagents)
subagent-fork/ In-process backend: a child seeded with the parent's completed-turn prefix (registers on ctx.subagents)
tool-subagent/ Model-facing subagent delegation tool over ctx.subagents (registers on ctx.tools)

The interface lives at subagent/subagent/. The in-process subagent-spawn / subagent-fork backends ship here; the out-of-process dsh-subagent-acp and the test-only dsh-subagent-mock (in support) are separate. All product packages except the mock.

The proposal and design rationale: docs/rfc/proposed/feature/2026-06-21-subagent-capability-seam.md.