Add subagent capability seam: interface, mock backend, model-facing tool
Introduce the `packages/subagent/` group and the abstract subagent seam — an
agent delegating to a child agent — as a named-provider registry (`ctx.subagents`),
unlike the single-implementation bash seam, so multiple transports (in-process,
ACP, future A2A) coexist. This first PR lands the interface, a scripted test
backend, and the model-facing tool, validated through the real cordis load path.
- dsh-subagent: SubagentService registry + SubagentProvider/SubagentRun
vocabulary + subagent/start|end events. Start-time capabilities (outputSchema,
depthLimit, toolFilter) are checked pre-start and rejected loud; runtime
capabilities (sendMessage, resume) are optional methods on SubagentRun.
- dsh-subagent-mock (support): scripted provider for keyless, deterministic
tests through the real Loader/export path.
- dsh-tool-subagent: the model-facing `subagent` tool, config-bound to one
provider; synchronous collect with try/finally dispose, signal->cancel
bridging, and non-completed-stop-reason -> isError mapping.
- Proposed RFC documenting the seam, the fork-vs-spawn-as-separate-backends
decision, own-session isolation, synchronous-collect scope, and the deferral
of background/poll/spill to a future unification with bash.
- Wire the new group into tsconfigs, build refs, package hierarchy docs, the
module graph, and the cordis catalog.
RFC: docs/rfc/proposed/feature/2026-06-21-subagent-capability-seam.md
2026-06-21 22:31:56 +08:00
# subagent/ — subagent capability family
2026-07-26 05:03:53 +08:00
English | [中文 ](README.zh.md )
2026-08-04 00:54:19 +08:00
This family lets an agent delegate work to child agents. Multiple named providers may coexist in one context.
Add subagent capability seam: interface, mock backend, model-facing tool
Introduce the `packages/subagent/` group and the abstract subagent seam — an
agent delegating to a child agent — as a named-provider registry (`ctx.subagents`),
unlike the single-implementation bash seam, so multiple transports (in-process,
ACP, future A2A) coexist. This first PR lands the interface, a scripted test
backend, and the model-facing tool, validated through the real cordis load path.
- dsh-subagent: SubagentService registry + SubagentProvider/SubagentRun
vocabulary + subagent/start|end events. Start-time capabilities (outputSchema,
depthLimit, toolFilter) are checked pre-start and rejected loud; runtime
capabilities (sendMessage, resume) are optional methods on SubagentRun.
- dsh-subagent-mock (support): scripted provider for keyless, deterministic
tests through the real Loader/export path.
- dsh-tool-subagent: the model-facing `subagent` tool, config-bound to one
provider; synchronous collect with try/finally dispose, signal->cancel
bridging, and non-completed-stop-reason -> isError mapping.
- Proposed RFC documenting the seam, the fork-vs-spawn-as-separate-backends
decision, own-session isolation, synchronous-collect scope, and the deferral
of background/poll/spill to a future unification with bash.
- Wire the new group into tsconfigs, build refs, package hierarchy docs, the
module graph, and the cordis catalog.
RFC: docs/rfc/proposed/feature/2026-06-21-subagent-capability-seam.md
2026-06-21 22:31:56 +08:00
| Package | Role | ctx key |
|---|---|---|
2026-08-04 00:54:19 +08:00
| [`subagent/` ](subagent/README.md ) | Defines provider registration, delegation, and continuation | `ctx.subagents` |
| [`subagent-inprocess/` ](subagent-inprocess/README.md ) | Provides the shared in-process run driver | — |
| [`subagent-spawn/` ](subagent-spawn/README.md ) | Starts a fresh in-process child | registers on `ctx.subagents` |
| [`subagent-fork/` ](subagent-fork/README.md ) | Starts an in-process child from the parent's completed history | registers on `ctx.subagents` |
| [`subagent-acp/` ](subagent-acp/README.md ) | Starts an out-of-process child over ACP | registers on `ctx.subagents` |
2026-08-06 21:26:31 +08:00
| [`subagent-codex/` ](subagent-codex/README.md ) | Starts a real Codex app-server child | registers on `ctx.subagents` |
2026-08-06 21:38:47 +08:00
| [`subagent-claude-code/` ](subagent-claude-code/README.md ) | Starts a real Claude Code child through the official Claude Agent SDK | registers on `ctx.subagents` |
2026-08-04 00:54:19 +08:00
| [`subagent-dsh-sdk/` ](subagent-dsh-sdk/README.md ) | Starts an out-of-process Harness child through the TypeScript SDK | registers on `ctx.subagents` |
| [`tool-subagent/` ](tool-subagent/README.md ) | Exposes delegation to the model | registers on `ctx.tools` |
| [`tool-subagent-control/` ](tool-subagent-control/README.md ) | Exposes child messaging and listing to the model | registers on `ctx.tools` |
| [`tool-subagent-report/` ](tool-subagent-report/README.md ) | Provides the child-to-parent report channel | registers in child scopes |
Add subagent capability seam: interface, mock backend, model-facing tool
Introduce the `packages/subagent/` group and the abstract subagent seam — an
agent delegating to a child agent — as a named-provider registry (`ctx.subagents`),
unlike the single-implementation bash seam, so multiple transports (in-process,
ACP, future A2A) coexist. This first PR lands the interface, a scripted test
backend, and the model-facing tool, validated through the real cordis load path.
- dsh-subagent: SubagentService registry + SubagentProvider/SubagentRun
vocabulary + subagent/start|end events. Start-time capabilities (outputSchema,
depthLimit, toolFilter) are checked pre-start and rejected loud; runtime
capabilities (sendMessage, resume) are optional methods on SubagentRun.
- dsh-subagent-mock (support): scripted provider for keyless, deterministic
tests through the real Loader/export path.
- dsh-tool-subagent: the model-facing `subagent` tool, config-bound to one
provider; synchronous collect with try/finally dispose, signal->cancel
bridging, and non-completed-stop-reason -> isError mapping.
- Proposed RFC documenting the seam, the fork-vs-spawn-as-separate-backends
decision, own-session isolation, synchronous-collect scope, and the deferral
of background/poll/spill to a future unification with bash.
- Wire the new group into tsconfigs, build refs, package hierarchy docs, the
module graph, and the cordis catalog.
RFC: docs/rfc/proposed/feature/2026-06-21-subagent-capability-seam.md
2026-06-21 22:31:56 +08:00
2026-08-04 00:54:19 +08:00
See the decisions for the [capability family ](../../.agents/notes/implemented/feature/2026-06-21-subagent-capability-seam.md ), [continuable children ](../../.agents/notes/implemented/feature/2026-07-21-continuable-background-subagents.md ), and [control tools ](../../.agents/notes/implemented/simplification/2026-07-26-merge-subagent-control-service.md ).