Preface¶
When delegating in DeepSeek Harness (DSH), parent sessions often have to write the provider, model, and reasoning effort in the tool parameters every time, as well as select an agent preset. The Harness’s built-in subagent path labels the child session as a “subagent,” causing the client to hide the model selector, making child tasks visually distinct from user-initiated manual Sessions in the interface.
The following introduces the community plugin dsh-subagent-templates (maintained by windwhiterain). Under DSH’s “everything is a plugin” philosophy, it uses named templates to fix the initial routing for child tasks (a single provider/model or resolved from a route pool), agent presets, and optional personas. The delegator selects based on template ID and description rather than repeatedly filling in model parameters each time. The plugin is categorized as a workflow, currently at version 0.1.0 (MIT). The GitHub repository windwhiterain/dsh-subagent-templates has approximately 1 star. The directory page can be found on SkillHub (a community site with no official affiliation to DeepSeek / High-Flyer).
What is this¶
dsh-subagent-templates is an out-of-tree plugin package: excluding the schema library @deepseek-ai/schemastery, it does not depend on Harness runtime packages. It implements delegation logic in JavaScript on top of the ctx service without modifying the Harness source code checkout.
Each template defines:
- Starting route:
provider+model, orpool(a route pool provided by dsh-llm-quota-retry, resolved per child task); - preset (agent preset, omitted if default deployment is used);
- Optional persona, reasoningEffort, maxTokens, toolFilter.
The parent agent delegates via the Host-plane tool subagent (configurable via toolName, defaults to subagent) based on the template. Results from background tasks are automatically returned to the parent session without requiring extra collection calls (see README “Results”).
Core Design: Template Child Sessions are Ordinary Root Sessions¶
A template delegation is not a native Harness subagent but follows the same path as a Session manually opened by a user in the interface:
workspaceRegistry.create(cwd) → a workspace in the parent's directory
agents.create({ sessionId }) → a top-level Agent on the template's route
workspace.attachSession(id) → it appears in the normal session list
agent.followup(prompt) → it starts working
Consequently:
- Model selector remains available—The child session header intentionally lacks
parentSession/origin, so the client does not treat it as a subagent and hide the picker. - Template routing is only the initial value—If the user changes the picker, the child session’s own durable request header prevails.
- Child sessions can delegate again—The
subagenttool remains available under the same preset combination; nesting depth is constrained by configurations likemaxDepthand does not consume the recursion budget ofctx.subagents.
The parent-child relationship exists in the plugin’s own storage domain subagent_templates (in the children table), rather than in the Session header.
Managing Child Tasks by Name¶
Every delegation must include a non-empty name, serving as the child session title and unique handle (live children names cannot be duplicated within the same parent session). The parent side references child tasks by name, e.g., via list_subagents, message_subagent, interrupt_subagent, delete_subagent (can delete multiple names or "*" at once); the model-side tool results and settlement notifications also use names, exposing no Session IDs.
Division of Labor with Native Subagent Tools¶
Template child sessions are intentionally not registered in ctx.subagents; otherwise, the client would hide the model selector. Consequently, native list_agents, send_message, interrupt_agent, and subagent_fork cannot manage template child sessions. After the first successful delegation, the plugin mounts replacement capabilities in that session’s agent scope:
| Plugin Tool | Native Counterpart | Function |
|---|---|---|
list_subagents |
list_agents |
Lists child tasks in this session along with their templates and status (working/idle/ended). |
message_subagent |
send_message |
Sends messages by name to continue or start a new round. |
interrupt_subagent |
interrupt_agent |
Stops current work but retains the session and transcript. |
delete_subagent |
— | Terminates a child task by name. |
The Host plane also provides list_subagent_templates (lists templates with route/preset info). The child session side registers ask_parent, allowing the child agent to ask questions to the parent session (the parent is woken up when idle).
The client adds a Subagents right sidebar tab and a subagentTemplates Session projection to facilitate viewing, opening, or deleting child tasks in the UI (README notes: the shipped sidebar currently lacks parent-child grouping).
If you need to restore the native subagent control plane, you must re-enable lines like tool-subagent-control in the preset—this creates a dual surface with template delegation, which the README suggests generally avoiding.
Configuration Highlights¶
Override or extend plugin lines in the profile’s cordis.patch.yml (the bundle includes examples; the profile layer replaces the entire config, so necessary fields must be written out fully):
- id: subagent-templates
name: 'dsh-subagent-templates'
config:
toolName: subagent # optional; the model-facing tool name
maxDepth: 1 # optional; how deep delegation may nest (default 1)
maxActiveSubagents: 4 # optional; how many children may work at once (default 4)
templates: # required; at least one
- id: medium # required; lowercase letters, digits, hyphens; the `template` argument
name: Medium # required; display name
description: >- # required; when to pick this template, in the model's vocabulary
Executes and explores: reads code, runs commands, and reports what it found.
provider: command-code-goat # one route: a registered LLM provider id …
model: deepseek/deepseek-v4.1-flash # … and a model that provider serves
# pool: medium # … OR the name of a route pool owned by dsh-llm-quota-retry
preset: personal # optional; agent preset the child joins (default: the deployment default)
reasoningEffort: high # optional; the child's starting thinking effort
maxTokens: 64000 # optional
persona: You are… # optional; the child's own persona
toolFilter: # optional; the child's narrowed tool set
deny: [write]
Notes:
- Each template can choose only
provider+modelorpool;toolFilter’sallow: []means locking tools exceptask_parent. maxDepthdefaults to 1: child sessions cannot delegate further by default (sessions reaching the limit do not mountsubagent/list_subagent_templatesto avoid invalid tool errors every turn).maxActiveSubagentsdefaults to 4: upper limit of working child tasks simultaneously in the same parent session.- The Web Plugins settings page allows editing the template list and caps and writing back to the patch;
toolNamechanges require modification in the patch and a row restart.
Installation and Activation¶
The plugin runs with the current dsh process permissions; please read the repository source code and the MIT license before installation to ensure the configuration and tool exposure scope align with your deployment strategy.
Execute in the directory containing this repository checkout (README original text):
dsh plugin --profile <profile> add ./dsh-subagent-templates
You can also install via the Plugin Manager by selecting this directory; the bundle patch will insert the plugin line into the Host plane.
Since the row schema depends on schemastery, link installation does not automatically install dependencies. You must execute once within the checkout:
npm install
Failure to do so will result in ERR_MODULE_NOT_FOUND during activation. If you modify client injection items in dsh.client.inject, a host restart is required (due to client manifest caching).
If a headless profile mounts tool-subagent from dsh-base simultaneously, it will conflict with the template tool’s subagent name. You must disable it first:
- id: tool-subagent
disabled: true
The web profile disables this line by default.
Switching to Template Delegation in Presets¶
The README (“Use it in a preset”) suggests:
- In the profile’s
cordis.patch.yml, remove thetool-subagentline for that preset to let the Host-plane template tool exclusively own thesubagentname. - In the same preset, disable
tool-subagent-control,tool-subagent-control/list-agents, andtool-subagent-fork(they only recognizectx.subagents). tool-subagent-codexandtool-subagent-claude-codecan remain disabled by default; they utilize external CLIs and are distinct capabilities from template child sessions.
When delegating, the model calls subagent, specifying the template (template ID), a unique parent-side name, the task prompt, and whether to run_in_background. Foreground calls wait for the child task’s first round to naturally conclude and return the closing text; background calls return the name immediately, and subsequent notifications (subagent-settled) are sent to the parent session at the end of each round. You can first use list_subagent_templates to let the model see the routes and presets of various templates before selecting one for delegation.
Use Cases and Cautions¶
Suitable for: Users who need to delegate using fixed “Explore / Review / High Reasoning” roles within DSH for extended periods but want child tasks to function like ordinary Sessions in the UI (allowing model changes and conversation continuation); users who need to manage multiple parallel child tasks by name (default max 4 working simultaneously); users who want background delegation results automatically returned to the parent session.
Cautions:
- This is not the same path as native subagent fork or child agents inheriting context; templates focus on self-contained prompt delegation.
list_subagentsonly lists direct child tasks; grandchild tasks must be managed within that child session’s own toolset.- If the storage domain is not mounted,
maxDepth/maxActiveSubagentscannot be enforced (README notes that delegations proceed). - Plugin uninstall/HMR will not automatically kill created root Session child tasks; see README sections like “What a restart changes” for lifecycle, mapping, and adoption logic.
Conclusion¶
dsh-subagent-templates condenses “selecting model + selecting preset + writing persona” into named templates, and manages template child Sessions using independent storage and tool sets, completing the delegation workflow while preserving the full Session UI.
- Directory Page: https://www.skillhub.cn/plugins/windwhiterain/dsh-subagent-templates
- Source Code & Full Documentation: https://github.com/windwhiterain/dsh-subagent-templates