Preface¶
In DeepSeek Harness (DSH), long-running task execution accumulates a large amount of context: files read, errors encountered, commands executed. This content has no direct utility for subsequent steps, yet it continuously occupies context length. The dsh-tree-task-flow plugin manages multi-step tasks through a tree structure, automatically collapsing the execution process when a node completes, retaining only the results.
What Is It¶
This is a plugin that organizes multi-step tasks into a three-level tree of goal → task → subtask.
When each node completes, the AI submits the result, and the plugin then collapses the node’s execution process from the context, leaving only the result.
- Maintainer: viyiviyi
- License: MIT
Installation and Activation¶
Before installing, ensure the environment meets the requirements: Node.js version 22.19 or above, and dsh is installed and running.
Install from npm:
dsh plugin --profile web add dsh-tree-task-flow
After installation, dsh web must be restarted for it to take effect. Installation enables it automatically; no additional configuration is needed. If you don’t want to use it, you can disable it by setting enabled: false in the profile.
Core Features¶
The plugin provides a command-line interface (the /task-tree command series) and a tool-calling interface (the tree_task_* series).
- Tree Structure: Supports three-level nesting of goals, tasks, and subtasks.
- Context Collapse: When a node completes, collapses the node’s execution process, retaining only the result.
- UI Integration: Provides collapsible cards and an expanded list view.
Folding Logic¶
Folding follows the rule of “only looking at the surface layer, not depending on tree_task_plan” for segmentation:
- Start: The first tree_task_create call after the previous tree_task_done.
- End: Before the current tree_task_done call.
- Range processing: The start call and its return, as well as the end call and its return, remain in the context as-is; the intermediate process is taken away and replaced with a count notification.
- tree_task_plan: Not a boundary; it is taken away along with the intermediate process.
Tool Interface¶
The plugin provides the following tools:
| Tool Name | Purpose |
|---|---|
tree_task_create |
Create a new goal (start), also marks the folding start point |
tree_task_plan |
Append a child node to a node (add subtask to task, add task to goal) |
tree_task_done |
Complete a node and submit the result (finish), triggers folding |
tree_task_update |
Modify a node’s title or description |
tree_task_drop |
Discard a node (leave a mark, history retained) |
tree_task_delete |
Delete a node (remove, no trace) |
tree_task_status |
View the plan tree, defaults to only expanding unfinished goals |
Command-line Interface¶
The /task-tree command executes directly without going through the model:
| Command | Function |
|---|---|
/task-tree |
View the task tree and checkpoint status of this session |
/task-tree done <id> <result> |
Submit and complete the result of a node |
/task-tree drop <id> |
Discard a node |
/task-tree delete <id> |
Delete a node (remove along with child nodes) |
/task-tree pause |
Pause: running tools finish but then stop |
/task-tree resume |
Resume: continue from where it stopped |
/task-tree reset |
Clear the plan tree of this session |
UI and Configuration¶
The UI is integrated into the DSH Web interface, with a “Tree Task Flow” entry above the input box.
- When folded: Displayed as a 36px single-line bar, containing phase label, goal title, progress, and pause/resume, clear plan, expand buttons.
- When expanded: Displays a three-level tree, defaults to only expanding the current path, with other nodes collapsed. Supports viewing full text, completing, discarding, and deleting operations.
Configuration items are located at $DSH_HOME/profiles/<name>/cordis.patch.yml or the DSH settings panel:
- enabled: Master switch.
- autoContinue: Whether to automatically continue when the model stops.
- interruptRecovery: Whether to automatically recover after an unexpected interruption.
Use Cases and Notes¶
- Suitable for developers who need to break down complex tasks and want to keep the context clean.
- The plugin runs with the current dsh process permissions; it is recommended to check the source code and license before installation.
- Data is automatically fetched every 4 seconds, and the UI updates automatically.
Summary¶
dsh-tree-task-flow solves the context bloat problem in long-task execution through tree structure management and context folding mechanisms. It separates “process” from “result,” allowing subsequent steps to always focus on the node that needs to be completed at the moment.