description: "The out-of-process SDK subagent backend for users and maintainers choosing a delegation provider, configuring a child Harness runtime, or debugging local nested child runs."
English | 中文
dsh-subagent-dsh-sdk runs each delegated task in a fresh DeepSeek Harness subprocess with its own profile, session, model route, and tools. The parent provides the task and working directory, while each child uses its configured runtime and remains isolated from the parent conversation. The parent receives the child's final assistant text or a safe error; intermediate messages and tool traffic stay inside the child process. Choose this backend when delegation needs a complete Harness runtime rather than shared in-process state, and accept the cost of starting a new process for every run.
Mount this provider when a delegation should run as a complete Harness runtime in its own process. The common path is explicit: mount the seam, mount this provider, configure dshBin when needed, and select the child profile and ordered patches.
Choose this backend when the child must be a full harness peer — its own composition, session persistence, model route, and tools — rather than an agent that shares the parent's process. Choose an in-process backend when the child must share the parent's composition or honor parent-enforced non-route capabilities: this provider accepts agent route options but rejects structured output, depth caps, tool filters, and personas rather than silently omitting them.
The provider advertises agentOptions: true, with outputSchema/depthLimit/toolFilter/persona false, and inheritsParentContext: false. Its immutable agentRouteDefaults publish the configured provider/model baseline to dsh-tool-subagent before model overrides and exact-route preflight; start() independently applies the same configuration defaults for direct callers and maxTokens. Agent route values cross the SDK wire as an explicit whitelist; the child remains a fresh runtime in another process, and the only value derived from the parent agent itself is the workspace cwd. dsh-tool-subagent deployments over this provider set maxDepth: 'provider-managed' — the child harness owns its own recursion budget.
| Field | Default | Meaning |
|---|---|---|
providerName |
dsh-sdk |
Registry name on ctx.subagents |
dshBin |
SDK dependency | Explicit dsh CLI module, resolved and checked at plugin load; omission uses the SDK dependency |
profile |
sdk |
Named child profile |
patches |
[] |
Ordered per-launch profile patch files, resolved and checked at plugin load |
dshHome |
required | Absolute isolated Harness home for every nested child process |
cwd |
parent session cwd | Working-directory override for the child process and its SDK session |
provider |
deepseek-official |
Provider route sent in the child's initialize |
model |
deepseek-v4-flash |
Model sent in the child's initialize |
maxTokens |
adapter/provider route default | Per-request output-token cap sent in the child's initialize |
env |
{} |
Explicit child environment layered over the credential-scrubbed parent environment |
shutdownTimeoutMs |
1000 |
Bound on the protocol shutdown exchange during dispose |
disposeEofGraceMs |
6000 |
Grace after stdin EOF before platform termination |
disposeGraceMs |
3000 |
Exit-confirmation grace after termination |
The generated configuration catalog is the exhaustive source for every accepted field and its JSDoc.
Request agentOptions override provider, model, and maxTokens independently. reasoningEffort has no provider-instance default: an omitted request leaves it absent so the selected child model resolves its own default. The model-facing subagent tool can select provider/model/reasoning per call; maxTokens remains deployment-controlled through tool config or this provider's default.
- id: subagent-dsh-sdk
name: '@deepseek-ai/dsh-subagent-dsh-sdk'
config:
providerName: dsh-sdk
profile: sdk
patches: ['./profiles/research-child.cordis.yml']
dshHome: !!js dshHomePath('children')
maxTokens: 49152
env:
DEEPSEEK_API_KEY: !!js process.env.DEEPSEEK_API_KEY
- id: tool-subagent
name: '@deepseek-ai/dsh-tool-subagent'
config: { provider: dsh-sdk, toolName: subagent, maxDepth: 'provider-managed' }
A successful run returns the child's final assistant text (or accumulated partial text after cancellation) as result output. The child's model route, tools, and session come from the child runtime itself — the parent supplies the task, working directory, and initialize route. The child's last durable turn/end maps into the seam vocabulary: completed and max-tokens pass through, blocked becomes refusal, and an unexpected or missing terminal becomes error. An aborted result stays aborted; only a child-side disposed cause adds a child-disposed diagnostic.
An already-aborted request fails before path resolution or spawn. A route, spawn, handshake, or pre-publication cancellation failure ordinarily rejects only after the subprocess is reaped. If initialization and cleanup both fail, the ordered safe facts preserve both failures without claiming quiescence. A child runtime that fails after publication settles through the run rather than rejecting it; partial output stays separate from the safe diagnostic. Diagnostics expose only the provider plus initialize, session-run, or shutdown stage and a fixed category. They never copy SDK messages, stderr, paths, task content, environment values, credentials, or protocol payloads.
Read these pages when the package-level contract is not enough. They move from this backend to the seam it plugs into and the SDK it drives.
The child runtime's model receives the standalone task as its user message plus that runtime's own configured system prompt, tools, and fresh session. It receives no parent conversation. A parent tool call may choose the child provider, model, and reasoning effort for this run; the selected route and any deployment-owned output cap are fixed for the new child process. Persona, tool filtering, depth enforcement, and structured output remain unsupported and are rejected instead of silently omitted.
The child pays for an independent full context and its own multi-step history. These tokens never enter the parent's context.
Independent of the parent request cache. Each SDK child can reuse only prefixes identical under its own provider, model, composition, and history; child steps otherwise grow append-only.
Through dsh-tool-subagent, the parent receives only the child's final assistant text (or accumulated partial text) or that consumer's exact stop-reason error, not intermediate messages or tool traffic. A diagnostic-bearing non-completed result presents the safe diagnostic before separately preserved partial assistant output; startup and shutdown errors expose the same fixed facts without raw SDK text.
Parent input grows only by the final result or error, which is data-dependent and retained until compaction. This provider adds no parent schema itself.
Append-only; newly visible content follows the reusable request prefix and does not invalidate existing KV-cache entries.
These limits define when this backend is a poor fit or needs special operational care. They are current package constraints, not a general SDK comparison or a task backlog.
outputSchema, depth, tool filters, or persona inside the child process; configure the selected child profile and its ordered patches instead.session.event channel is consumed for output extraction, not bridged into the parent log.Runtime invariant: No companion is published. Run lifecycle pairing is owned and checked by the subagent seam's invariant; this backend's own state lives in the child process beyond this context's event streams.