rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:xie-tj/dsh-subagent
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 中文
dsh-subagent is a community DeepSeek Harness plugin that turns named subagent profiles into model-visible delegation tools. Each profile fixes a backend, a model route, and a reasoning policy, and exposes one tool named subagent_<profile> to every live root Agent.
This repository is independent of the core @deepseek-ai/dsh-subagent package. The core package provides the ctx.subagents service; this plugin composes that service into configurable tools such as subagent_fast and subagent_reviewer, plus the custom_subagent management tool.
spawn for an independent child context or fork to inherit the completed parent conversation.custom_subagent tool.custom_subagent set-default action. While set, every root Agent's system prompt gains one short section that nudges unnamed delegation requests toward the matching subagent_<name> tool.| Requirement | Version / detail | How to check |
|---|---|---|
| DeepSeek Harness | 0.1.1-rc.2 compatible packages (this plugin's peerDeps pin 0.1.1-rc.2) |
dsh --version |
| DSH profile | The profile you want to extend must be web (or another profile that loads the Web UI). headless and tui profiles do not surface the settings page. |
dsh profile list |
| Node.js | ^22.19.0 or >=24.0.0 |
node -v |
| pnpm | On PATH; the CLI delegates installs to pnpm |
pnpm -v |
| Base composition | A profile that ships spawn and fork subagent providers and the model catalog. The shipped web and headless profiles do; custom profiles must include @deepseek-ai/dsh-subagent-spawn and @deepseek-ai/dsh-subagent-fork (or equivalent providers) plus the dsh-tool-subagent capability. |
dsh plugin --profile web why (look for dsh-tool-subagent, dsh-subagent-spawn, dsh-subagent-fork) |
| Network | HTTPS to github.com and registry.npmjs.org for the GitHub install path |
curl -fsI https://github.com |
If any check fails, fix it before installing the plugin. The CLI does not auto-install missing prerequisites.
| Path | When to use | Builds required? |
|---|---|---|
| GitHub (recommended for users) | You want a reproducible install of a published version. Pin to a commit SHA in production. | No (the repo ships executable JavaScript). |
| Local checkout | You are developing or debugging the plugin and want changes picked up after restart. | pnpm install once. |
| npm registry | When (and if) a future release is published to npm. | No. |
Install the plugin into the Web profile:
dsh plugin --profile web add github:xie-tj/dsh-subagent
For reproducible installations, pin a commit:
dsh plugin --profile web add github:xie-tj/dsh-subagent#09402ca21e086bed604f86818624a7435d65b572
(09402ca2 is the current published commit on main; replace it with the SHA you want to lock to.)
The CLI initializes the profile directory if it is missing, then delegates the rest to pnpm. Relative path specs (e.g. add . from a plugin checkout) are anchored to your current working directory, not the profile.
Verify the install:
dsh plugin --profile web why | grep -i dsh-subagent
You should see the plugin name, version, and its declared cordis.patch.yml layer in the dependency tree.
git clone https://github.com/xie-tj/dsh-subagent.git
cd dsh-subagent
pnpm install
dsh plugin --profile web add .
pnpm install resolves the plugin's own devDependencies (loader and include helpers, dsh-scope). The CLI then registers the directory as a local dependency in the Web profile. Edits inside dsh-subagent/ take effect after restarting the Web profile.
dsh --profile web
Open http://127.0.0.1:3080 (or the URL printed by the CLI), then go to Settings → Subagents. The initial profiles are listed in the Usage tutorial below.
web profileThe plugin declares dsh.client.platform: web. The settings UI and the subagent_<name> tools require a profile that loads the Web runtime. To install into a different profile, add it the same way:
dsh plugin --profile <name> add github:xie-tj/dsh-subagent
…but the profile must additionally load @deepseek-ai/dsh-client-ui-settings (or the settings UI consumer you want) for Settings → Subagents to render. The custom_subagent management tool is always available to the Agent regardless of UI.
The plugin keeps no on-disk state of its own. Three locations matter:
dsh-subagent namespace with profiles and the optional defaultProfile. The Settings page and the custom_subagent tool both write here. Find the file with dsh plugin --profile web why (look for the settings entry) or the DSH_HOME / $DSH_HOME environment variable.package.json lists the plugin under dependencies. The CLI reconciles this with the actual install state on every add / remove / update. To audit: dsh plugin --profile web why.cordis.patch.yml is merged into the profile's Cordis composition by the CLI's bundle reconciler. Inspecting it requires reading the profile's resolved cordis.yml; the easiest way is dsh plugin --profile web why | grep -A2 'dsh-subagent'.The plugin does not read the retired $DSH_HOME/custom-subagents.json file. Flat provider, model, and reasoningEffort fields belong to an obsolete pre-release format and are rejected at load.
Open Settings → Subagents. The initial profiles are:
| Profile | Backend | Model route | Reasoning | Child context |
|---|---|---|---|---|
fast |
spawn |
Follow conversation | Custom low |
Independent context |
reviewer |
fork |
Follow conversation | Custom high |
Inherits the completed parent conversation |
These are editable user profiles supplied as initial plugin settings, not read-only DSH system profiles.
Select Edit on a profile and choose:
spawn or fork.Custom routing always stores Provider and Model together. If the selected route disappears from the live model catalog, the UI shows the stale value and blocks saving until a valid route is selected.
Select New subagent, enter a lower-case identifier such as deep-research, and configure its backend and policies. Profile names must match:
^[a-z][a-z0-9_-]{0,23}$
The profile immediately creates a tool named subagent_deep-research for each live root Agent.
Pick a profile in the Default subagent selector at the top of the page, or call the custom_subagent set-default action (omitting name clears the designation). While set, each root Agent's system prompt gains one short section: delegation requests that name no profile — such as "open a subagent" — prefer the matching subagent_<name> tool.
A defaultProfile that names no existing profile is rejected at load and at save time. The current default profile cannot be deleted until another default is chosen or the designation is cleared.
Ask the Agent to delegate work to the named profile, for example:
Use the reviewer subagent to inspect this change for correctness and test gaps.
The Agent can call subagent_reviewer; routing choices are fixed by the saved profile and are not exposed as tool-call arguments.
The Settings page and custom_subagent tool write the same dsh-subagent settings namespace. A representative settings.yaml section is:
dsh-subagent:
defaultProfile: fast
profiles:
- name: fast
description: Quick lookups and lightweight checks.
backend: spawn
modelRouting:
mode: follow-conversation
reasoning:
mode: custom
effort: low
- name: reviewer
description: Review changes with a dedicated model.
backend: fork
modelRouting:
mode: custom
provider: openai-codex
model: gpt-5.6-luna
reasoning:
mode: custom
effort: high
modelRouting is either { mode: 'follow-conversation' } or an atomic custom { mode: 'custom', provider, model } record. reasoning independently follows the conversation or stores { mode: 'custom', effort }.
The optional defaultProfile names the delegation tool used when no profile is named; it must exist in profiles. Deleting the current default profile is refused until another default is chosen or the field is cleared.
The plugin does not read the retired $DSH_HOME/custom-subagents.json file. Flat provider, model, and reasoningEffort fields belong to an obsolete pre-release format and are rejected.
dsh plugin --profile web add github:xie-tj/dsh-subagent#<new-commit-sha>
dsh --profile web
The CLI reconciles the manifest and the cordis.patch.yml layer. Restart the profile to load the new code; existing continuable children keep the route they were created with.
Same command, with an older SHA. The CLI does not store a history of past versions, so keep your own notes of which SHA you want to roll back to.
dsh plugin --profile web remove dsh-subagent
dsh --profile web
Removing the plugin removes the dependency from the profile's package.json and the dsh-subagent layer from the resolved composition. It does not delete the dsh-subagent namespace from the settings file. If you also want to wipe saved profiles, edit the settings file (see Where state lives) and remove the dsh-subagent: block manually. Reinstalling the plugin later will not recreate the previous profiles.
| Symptom | Likely cause | Fix |
|---|---|---|
| No "Subagents" section in Settings | Plugin is installed in a profile that does not load the Web UI, or the profile was not restarted after install. | Confirm the profile: dsh plugin --profile web why | grep dsh-subagent. Restart: dsh --profile web. |
dsh plugin --profile web add fails with peerDependency error |
DSH core packages are older than 0.1.1-rc.2. |
Upgrade DSH (see your distribution's upgrade steps), then retry. |
cordis.patch.yml not visible in dsh plugin --profile web why |
The plugin's manifest was not picked up by the CLI's bundle reconciler, often because the dependency was added manually rather than through dsh plugin add. |
Re-add through the CLI: dsh plugin --profile web remove dsh-subagent && dsh plugin --profile web add github:xie-tj/dsh-subagent#<sha>. |
| A custom route cannot be saved | The selected Provider/Model/effort is not in the live Host model catalog. | Refresh the catalog from the settings page, or pick a route the catalog currently returns. |
Duplicate subagent_<name> or custom_subagent registration |
Another dynamic subagent-profile plugin is mounted alongside this one. | Stop and remove the older plugin before enabling this one. |
| Deleting a profile reports it as the default subagent | defaultProfile still names it. |
Pick a different default (or "不设置" / unset) first, then delete. |
No provider for spawn or fork |
The profile is missing the subagent providers. | Use a profile that ships them, or add @deepseek-ai/dsh-subagent-spawn / @deepseek-ai/dsh-subagent-fork (or equivalent) and the dsh-tool-subagent capability to the profile. |
| Settings lost after reinstall | The dsh-subagent namespace lives in the settings file; dsh plugin remove does not delete it. |
Restore from your settings backup, or re-create the profiles through Settings → Subagents. |
defaultProfile rejected on load |
The saved default names a profile that no longer exists. | Edit the settings file and either remove the defaultProfile line or set it to an existing profile name, then restart. |
subagent_<name>), plus the Agent-scoped custom_subagent management tool.dsh plugin remove does not delete the dsh-subagent namespace from the settings file. Wipe it manually if you want a clean slate.pnpm install
pnpm test
pnpm test runs schema/runtime tests, browser-client registration and rendering tests, and a real Cordis Loader composition lifecycle test.
The repository ships executable JavaScript and does not need a build step for installation.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。