dsh-roles-zeta: Role-File-Driven DSH Sub-Agent Delegation

Introduction

When working on complex tasks in DeepSeek Harness (DSH), the main agent often needs to hand a piece of work to a sub-agent: switching models, switching personas, narrowing the tool surface, and then threading the results back into the current session. The built-in subagent and subagent_fork tools let you choose routing per call, but “fixed posts”—such as dedicated review, codebase exploration, or log distillation—are better written as versionable, overridable configuration rather than repeated in the prompt every time.

dsh-roles-zeta takes a different path: it mounts a delegate tool onto the main agent, with role definitions stored as Markdown files under $DSH_HOME/agents (default ~/.dsh/agents). At call time you specify a role id; the sub-agent’s persona, model routing, reasoning effort, and tool whitelist are determined by that file. Under the hood it still goes through the same ctx.subagents service as the built-in subagent, so behavior around provider, delegation depth, continuation, and background settlement stays consistent with the Harness’s original mechanisms.

What Is This

An open-source DSH plugin by maintainer zeta987, categorized under “Workflow” in the community directory. In one line: role-file-based sub-agent delegation—a single delegate tool covers the entire role roster. The plugin requires dsh 0.2.1-rc.2 or higher (delegation needs to carry the Agent Preset semantics of “no built-in persona / tool filtering”); the runtime requires Node >= 22.19.0 (see package.json). The current npm package version is 0.5.0, licensed under MIT.

The built-in subagent and subagent_fork are not unloaded: models can still be routed per call; roles are fixed when the file is written. Each role is delivered to the sub-agent as an Agent Preset—copying the caller’s preset, then layering the role’s persona on top, and keeping only the plugins its tools require.

Core Features

Relationship Between delegate and the Built-in Sub-Agents

The tool name visible to the main agent defaults to delegate (can be changed to another toolName in the configuration). One call passes a role id and the task text; the plugin parses the frontmatter and body of the corresponding .md and launches the sub-agent via ctx.subagents. Compared with hand-written subagent calls, the difference is that routing and persona come from role files on disk, and directory changes can trigger an automatic reload after a short quiet period (watchRolesDir defaults to true).

Eight Bundled Roles

On first load, the plugin writes the package’s role seeds into ~/.dsh/agents and generates a .seeded.json recording the seed state. Default filenames include:

~/.dsh/agents
├── code-mapper-lite.md   explorer.md            log-distiller.md   triage.md
├── deep-coordinator.md   hypothesis-debate.md   reviewer.md        worker.md
└── .seeded.json

In a new session, the tool description for delegate lists the roles currently in the roster.

Web Slash Commands

Each loaded role corresponds to a slash command in the Web input box (alongside /plan, /goal, etc.). Typing / lets you browse; for example, /reviewer look at lib/index.js queues a conversation turn that asks the main agent to call delegate in the foreground with the reviewer role and pass that sentence as the task—the delegation still appears as an ordinary tool call and remains in the transcript.

Adding, deleting, or modifying role files re-registers commands; if an id conflicts with another plugin’s command, that role skips slash registration (a log entry is written) but can still be used via delegate. Setting commands: false disables all; commandPrefix: "r-" makes commands look like /r-reviewer.

Settings Page: Role Agents

Path: Settings → Role agents. The list shows each role with markers such as shipped / yours / edited; the editor lets you change the id, the when line, route, effort, tool checkboxes (or “inherit all” plus a delegation toggle), and the persona body. Saving writes to $DSH_HOME/agents/<id>.md, the same file you would edit manually.

Deleting a custom role deletes the file; deleting a bundled role leaves a disabled: true stub, the bundled copy is no longer loaded, and it is listed under “Disabled shipped roles” until restored. Restoring one or all bundled roles copies the package files back (without touching your newly added roles).

The page is served via JSON routes under /__dsh/roles-zeta/, with the same authentication as the rest of the Web API. When settingsPage: false, neither the page nor the related APIs are mounted.

Role File Format

One Markdown file per role: YAML frontmatter for machine reading, the body serving as a prefix for the sub-agent’s persona. Example (excerpt from the README):

---
id: reviewer
when: Deep read-only reviewer for correctness, regressions, edge cases, and missing tests.
route: deepseek-official/deepseek-flash
effort: high
allow: [read, glob, grep, web_search, web_fetch, skill]
---

Review like an owner.
Prioritize correctness, regressions, edge cases, and missing tests.
Field Required Meaning
id Yes Role id; underscore and hyphen spellings parse to the same role
when Yes A one-line description; shown in the model menu and slash command descriptions
route No Model id or an exact provider/model
effort No off / minimal / low / medium / high / xhigh / max, clamped according to the route
allow No List of sub-agent tool names; if omitted, inherit all; [] keeps no tool plugins
delegation No When there is no allow list, if true the sub-agent still keeps delegation-type plugins
disabled No When true, disables a bundled role

When an allow list exists, delegation can continue only if the list contains the delegation tool name; with no list, delegation: true is required to delegate.

Load Order and Override Rules

Two root directories, the latter overrides the former: the package’s roles/*.md, then $DSH_HOME/agents. Bundled files you have not changed are updated along with plugin versions; once changed, they count as “yours” and will not be overwritten. Deleting a file will not re-seed it, but the in-package copy still loads—to remove it entirely you need a disabled stub or deletion via the settings page. Files you add yourself coexist with bundled roles. seedRolesDir: false stops writing seeds into your directory; watchRolesDir: false makes it read the directory only once at compose time.

Installation and Activation

DSH isolates plugin installation roots per profile, so the plugin must be installed separately in each profile where it will be used. The commands from the official README are as follows:

dsh plugin --profile web add dsh-roles-zeta
# restart the host

Forms such as github:zeta987/dsh-roles-zeta or file:<path> are also supported. After installation, the host must be restarted for the plugin to load.

The plugin does not auto-upgrade. To pin a specific release, you must specify the version explicitly (README example):

dsh plugin --profile web add dsh-roles-zeta@0.4.0
# restart the host

update only floats within the ^0.x range that pnpm recorded at install time; pnpm 11+ applies the minimumReleaseAge restriction to versions published less than 24 hours ago, and an explicit @version allows immediate installation. Role files you have modified will not be overwritten; bundled files you have never touched will be refreshed along with the package on the next load.

Host configuration is inserted as a single line via a Cordis patch (excerpt):

- insert:
    - id: roles-zeta
      name: dsh-roles-zeta
      config:
        provider: spawn
        toolName: delegate
        backgroundMode: continuable
        maxDepth: 2

No model or path appears here: routing is determined by the route in the role files. This configuration lives at the host level, so every agent under every preset can see delegate.

Common configuration keys, default values, and meanings (excerpt from the README):

Field Default Meaning
dshHome $DSH_HOME or ~/.dsh Harness home directory used to derive the roles directory
rolesDir $DSH_HOME/agents Seed target and your override directory
seedRolesDir true Whether to write and maintain the bundled roster
watchRolesDir true Reload the roster after directory changes
commands true Whether to register a slash command for each role
commandPrefix (empty) Command name prefix
settingsPage true Whether to mount the settings API and page
provider spawn Provider name for ctx.subagents
toolName delegate Tool name exposed to the model
backgroundMode continuable Background delegation mode
maxDepth 2 Maximum delegation depth

Typical Usage

  1. Install in the web profile with the command above and restart the host.
  2. Open a new session and confirm the tool list contains delegate, with its description listing the eight default roles (or your customized roster).
  3. Command-line style: type /reviewer <task description> in the Web input box to have the main agent delegate to the reviewer in the foreground.
  4. Tool-call style: ask the model in the conversation to call delegate, with parameters specifying role and task (equivalent in effect to the slash command; both enter the transcript).
  5. Customize roles: edit in Settings → Role agents, or add/modify .md files directly under ~/.dsh/agents; after saving, wait for the directory watcher to take effect—no need to re-compose the profile (unless watchRolesDir was disabled).
  6. Narrow the tool surface: set allow: [read, glob, grep, ...] for a read-only review role, to avoid the sub-agent mounting unnecessary write-operation or shell-type tools.

Use Cases and Caveats

Who it’s for: teams or individual developers who need fixed “posts” in the DSH Web workflow—code review, repository exploration, log distillation, triage coordination, and so on—and want the roster to be Git-manageable, upgradable along with the package, and maintainable either through the UI or through files.

How to choose vs. the built-in subagent: temporary model switches and one-off forks should still use the built-in tools; for reusable persona + route + tool policies, writing them as role files and using delegate or /role-id is more convenient.

Security and permissions: the plugin runs with the same privileges as the current dsh process; allow only masks tool names and cannot replace your review of the host environment and the plugin source. Before installing, read the GitHub repository source and the MIT license, and confirm that the Markdown in rolesDir cannot be written by untrusted parties (any file can define sub-agent behavior).

Ecosystem note: DSH adopts an “everything is a plugin” extension approach; the SkillHub directory page is a community listing with no official affiliation with DeepSeek / High-Flyer.

Conclusion

dsh-roles-zeta consolidates sub-agent delegation into “one tool + one folder of roles”: it runs on the same tracks as the Harness’s built-in subagent service, while making posts maintainable and overridable through Markdown and the Web settings page. If you already use the DSH Web profile, you can install per the README, start with the eight default roles, then add or remove role files under ~/.dsh/agents according to your project’s needs.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye