Files
deepseek-harness/packages/subagent/subagent-spawn/README.md
T
Tianyi Cui 0c9ea3145f Extract the shared in-process driver into dsh-subagent-inprocess (review feedback)
The shared run driver lived inside dsh-subagent-spawn, so the spawn package
carried fork-aware seeding logic and dsh-subagent-fork depended backward on
dsh-subagent-spawn — the two in-process backends were not independent.

Move the driver (startInProcessRun, depthOf, SubagentDepthError,
InProcessRunOptions) into a new pure-library package
@deepseek-ai/dsh-subagent-inprocess that registers nothing. spawn and fork now
both depend only on that driver and neither knows about the other; spawn no
longer re-exports it and fork no longer imports from spawn.

Also wire BOTH backends in examples/coding-agent/cordis.yml (config-only): load
dsh-subagent-spawn + dsh-subagent-fork + two dsh-tool-subagent instances with
distinct toolNames (subagent → spawn, subagent_fork → fork), demonstrating that
exposing multiple transports needs no code change.
2026-06-22 14:27:38 +08:00

1.4 KiB

@deepseek-ai/dsh-subagent-spawn

The in-process spawn subagent backend: a SubagentProvider that runs each child as a fresh child Agent on the same cordis context (ctx.agents) — its own session, its own (or the parent's) model, zero inherited conversation. The cheapest transport, reusing the agent factory's quiescent AgentHandle teardown.

The run mechanics live in the shared @deepseek-ai/dsh-subagent-inprocess driver (startInProcessRun); this backend just passes no seed (a fresh child). The fork backend is an independent peer over the same driver — neither knows about the other.

What it does

start(request) delegates to startInProcessRun(ctx, request, { providerName }) with no seed: a fresh child agent with the parent's cwd/parentSession lineage and (by default) the parent's model. See the driver README for the full lifecycle (depth check, one-shot drive, result read, dispose).

Capabilities

{ outputSchema: false, depthLimit: true, toolFilter: false }. It constructs the child, so it enforces a recursion cap; structured output and tool-scoping are deferred (the service rejects a request needing either before start runs).

Config

Key Meaning
providerName Registry name on ctx.subagents (default spawn).