Preface¶
When performing long-running tasks with DSH or other coding agents, the context is easily overwhelmed by full file contents and command outputs, leading to blurred goals, lost plans, and redundant work. A common practice is to “dispatch multiple subagents,” but this easily veers to two extremes—subagents lacking tools and bouncing every step back to the root session, or subagents possessing excessive permissions, modifying files arbitrarily, and leaving behind background processes.
Below is an introduction to the DSH plugin dsh-root-planner-preset (Category: Workflow) released by community maintainer XiaoOu2024. It is an agent preset bundle that separates “who decides” from “who acts”: the root agent holds the plan and decision-making authority, while subagents read, write, and run commands within their respective _agents/<label>/ directories, reporting back with summaries. Structurally, it forbids subagents from leaving running processes. The plugin is retrievable in the SkillHub catalog, with source code and documentation available on GitHub (current package version 1.6.1, MIT License). SkillHub is a community plugin directory and has no official affiliation with DeepSeek or High-Flyer.
What is this¶
dsh-root-planner-preset is an agent preset for DeepSeek Harness. Its core philosophy is: Root decides, workers execute, and no child processes should remain hanging when the task ends.
- Root Agent: Plans, integrates, and decides which artifacts to merge into the main workspace.
- Subagent (
root-planner-workerpreset): Equipped with tools like file system and shell access, working within the boundaries of delegated tasks.run_in_backgroundis prohibited, making background command execution unreachable at the schema level. - The bundle also employs profile-level guards (
dsh-root-planner-preset/guard) to enforce “subagents only write to_agents/” as a call-level rejection, rather than relying solely on prompt conventions.
The runtime environment requires DSH ≥ 0.2.1-rc.2 (engines.dsh in package.json). Older versions may be rejected during installation; if composed on 0.2.0, subagents will silently use platform default presets, causing misalignment in personas and tool sets.
Core Features¶
Separation of Decision and Execution¶
When the root session selects the Root Planner preset, the root agent is responsible for goals, success criteria, task breakdown, and integration. Reading, file modification, and command execution are delegated to subagents, which report conclusions, minimal evidence, and specify which files were changed.
The workflow can be summarized as:
Root Agent ──Delegate──▶ Subagent ──Delegate──▶ … until maxDepth
│ │
└── Decisions, Integration, Specifying scope each worker can touch
Tool-equipped Workers with Boundaries¶
| Requirement | Mechanism | Description |
|---|---|---|
| Subagent can read, modify files, run commands | root-planner-worker mounts tool-fs, tool-pwsh, tool-web, and delegation rows |
Toolset is determined by the rows mounted by the preset, acting as an allow list |
| Cannot leave running processes | pwsh row enableRunInBackground: false |
Rejects background calls and removes run_in_background from the tool schema |
| Delegation depth | Host’s subagent.maxDepth |
Throws SubagentDepthError if exceeding the limit |
| Concurrent subagent count | subagent.maxActiveSubagents |
Reports subagent limit reached when exceeded; does not queue |
| Root decides, worker executes | persona.txt persona |
Prompt-level constraint |
Tools registered globally by the Host (including ops_glob, ops_grep, ops_inspect_local_file, ops_replace, and working_directory in 0.2.1-rc.2) cannot be removed by any preset; subagents will still see them. Other root-specific capabilities (such as workflow, plugin_manager, etc.) will not enter the worker preset.
One _agents/ Workspace Per Worker¶
Before delegating, the root agent creates _agents/<label>/ and writes the absolute path into the task. Subagents write only to this directory; other paths in the parent workspace are read-only for them. To modify parent directory files, they must submit a “change request” for the root to merge. It is recommended to add _agents/ to .gitignore to facilitate continuation within the same session.
The guard acts at the profile level: for sessions where origin === "subagent", write / edit / ops_replace operations falling outside _agents/ are rejected; shell workdir boundaries or absolute paths pointing to parent files in commands are also rejected. Root sessions are not subject to these fencing restrictions.
If other presets are used to delegate subagents within the same profile, the guard can be disabled in the profile patch:
- id: root-planner-guard
disabled: true
Note: Since shells can concatenate paths at runtime, parameter scanning cannot cover all scenarios; scanning for drive letter paths is particularly limited on POSIX. The documentation suggests that the parent agent perform fallback checks using timestamps before and after delegation:
# Before delegating
touch _agents/.mark-<label>
# After subagent reports
find . -path ./_agents -prune -o -type f -newer _agents/.mark-<label> -print
No output indicates that the subagent did not create or modify files outside _agents/.
Two Common Limits in Large Tasks¶
subagent limit reached (active child limit: N): Subagent slots are only released after the turn ends, the inbox is empty, and its subagents are destroyed. Wide fan-out can fill slots without automatic queuing. You can increasemaxActiveSubagentsin Settings → Subagents or delegate in batches.subagent depth N exceeds maxDepth M: Delegation initiated when the maximum depth is already reached. This indicates the depth limit is working correctly; the layer should read materials itself rather than delegating further.
Installation and Activation¶
First, check the version:
dsh --version
Requires ≥ 0.2.1-rc.2. Installation from npm (pre-built) is recommended:
dsh plugin --profile web add dsh-root-planner-preset
Alternatively, install from GitHub:
dsh plugin --profile web add github:XiaoOu2024/dsh-root-planner-preset
Restart dsh web after installation. It is normal if this package cannot be found in “Settings → Plugin Market” (the market only allows sources within the curated list); please use the commands above.
After installation, you must set the delegation depth in the Host (this is not part of the bundle and cannot be hardcoded by the plugin):
- Open Settings → Subagents → Depth Limit.
- Enter
2(Root 0 → Child 1 → Grandchild 2; do not enter0, otherwise all delegation will be disabled).
Then, start a new session and select Root Planner in the preset selector. Existing sessions lock the plugins and presets from the time of startup; change configurations require a new session.
Uninstallation example:
dsh plugin --profile web remove dsh-root-planner-preset
For more comprehensive troubleshooting, see the repository’s INSTALL.md.
Typical Usage¶
- Confirm DSH version and plugin installation, depth limit is
2, and root session preset is Root Planner (use the repository scriptnode tools/verify-session.mjs <session_dir>to verify if the root isroot-planner). - The root agent lists the plan and success criteria, creates
_agents/<label>/for subtasks requiring extensive reading or local modifications, and delegates, specifying the allowed files or directories in the task. - The subagent reads, writes, and executes commands within
_agents/<label>/, reporting a summary and list of artifacts upon completion; the root agent decides which files to merge into the main workspace. - If another layer of breakdown is needed, the depth 1 subagent continues to delegate; depth 2 is the leaf, and further delegation will result in a depth error.
Suitable for: Cross-file research, reverse analysis, code review, and tasks where “reading is heavy, modification is light” or “changes must be unified under root decision.”
Not suitable for: Quick fixes involving a single file (delegation overhead is high), or tasks requiring multiple subagents to modify the same workspace code in parallel (this preset intentionally uses directory isolation; for parallel writes to the main tree, use other presets like standard).
Scenarios and Precautions¶
- The plugin runs with the permissions of the current DSH process. Please read the source code and MIT License before installation to assess whether the guards and personas meet your security requirements.
- The guard constrains all delegated agents under the entire profile. When mixing with other presets, pay attention to whether
root-planner-guardneeds to be disabled. - Optional dependency
dsh-ops: If not installed, subagents still have tools likeread/glob/grep/writemounted by the preset; whether globalops_*appear depends on the Host and installed plugins. - Installing from GitHub requires
giton the PATH; running validations likeverify-patch.mjsrequires Node.
Conclusion¶
dsh-root-planner-preset uses a dual-preset approach (root root-planner + worker root-planner-worker), depth and active subagent limits, _agents/ isolation, and profile-level guards to create a reproducible workflow where “plans stay in root context, execution sinks to subagents” for long-running tasks. For entries and links, refer to: