Introduction¶
DeepSeek Harness (DSH) does not have a switch for “automatically spawning sub-agents”—whether to fan-out depends entirely on the model’s judgment of the task structure. When the model fails to identify parallelizable sub-lines, it serializes work that should have been parallelized, increasing costs and latency. This plugin hardcodes the most critical 5 checks into a permanent system prompt segment. It applies to every session and every preset, without relying on the model remembering to read AGENTS.md.
What is it¶
dsh-fanout-discipline is a fan-out discipline plugin for DeepSeek Harness. Developed by maintainer baiqiuzhang, it injects a system prompt to force the model to determine if sub-agents can be spawned in parallel before starting work. It does not change DSH’s capacity parameters; it simply transfers scenarios where “parallelization should occur” from model judgment to hardcoded rules.
Core Features¶
The plugin registers a systemPrompt.section (order: 191) covering 5 checks:
- Check before each round of work: Are there ≥2 independent sub-lines? If so, define exclusive ranges and spawn 2–4 at once.
- For ≥5 homogeneous entries, use
workflow/batched-subagent-fanoutinstead of spawning one by one. - Sub-agent tasks must be self-contained with a unique output path, returning only counts, paths, or exceptions.
- Scenarios where parallelization should not occur (write dependencies, shared output, GPU memory contention, edit-test-edit loops).
- If judged parallelizable but not spawned = shifting the serialization cost onto the user.
Installation and Activation¶
The plugin is enabled via configuration, with injection disabled by default:
config:
enabled: false # Disable injection
Once enabled, the plugin injects a fixed prefix into each session to guide the model in making fan-out decisions. You should check the source code and license before installing.
Typical Usage¶
After enabling the plugin, a new section is added to the system prompt of each session, instructing the model to check if the task can be decomposed into parallelizable sub-lines before starting. If fan-out conditions are met, the model will attempt to spawn sub-agents to process in parallel.
The plugin itself does not force spawning and has no deny mechanism—hard blocking would disrupt scenarios that should be serial, which is consistent with DSH’s capacity parameters (e.g., maxDepth, maxActiveSubagents, agent-loop.maxParallelToolCalls).
Use Cases and Notes¶
Suitable for scenarios requiring stable fan-out behavior, such as tasks where the model needs to consider parallelism at every start.
Notes:
- The plugin runs with the permissions of the current DSH process;
- You should check the source code and license before installing;
- It does not change DSH’s capacity parameters; those are DSH’s parameters, see “Related Parameters” in the README.
Related Parameters¶
| Parameter | Default | Location | Purpose |
|---|---|---|---|
subagent.maxDepth |
1 (2 on local) | profile - id: subagent |
Delegation depth allowed |
maxActiveSubagents |
8 | Plugin → Sub-agent → Limit | Max sub-agents online per tree |
agent-loop.maxParallelToolCalls |
20 (20 on local) | profile - id: agent-loop |
Max parallel tool calls per step |
tool-todo.allowParallelInProgress |
true | tool-todo in preset | Allow multiple parallel items in todo |
Summary¶
dsh-fanout-discipline reduces serialization costs by injecting a permanent system prompt segment, forcing the model to make fan-out decisions before starting every session. It does not alter DSH’s capacity parameters, providing only more stable fan-out behavior.
- Directory: https://www.skillhub.cn/plugins/baiqiuzhang/dsh-fanout-discipline
- GitHub: https://github.com/baiqiuzhang/dsh-fanout-discipline