DeepSeek Harness (DSH) adopts a plugin-based architecture. This plugin (dsh-dispatch) allows dispatching tasks to headless processes of the local ZCode CLI and monitoring these processes in a floating panel at the bottom-right corner of the DSH page. It provides features such as single-writer mutual exclusion, usage aggregation, and channel management.
Installation¶
This project does not publish an npm package. It must be installed from the GitHub repository with a specified subdirectory.
dsh plugin --profile web add "github:Shuffle-1992/dsh-dispatch#path:dispatch"
Note: #path:dispatch cannot be omitted. This repository is a monorepo, and the plugin itself is located in the dispatch/ subdirectory. When DSH actually runs pnpm add, pnpm defaults to the repository root directory, and since there is no plugin package.json at the root, only a placeholder will be installed.
Core Features¶
This plugin mainly provides the following capabilities:
- Dispatch: Supports handing over
prompt, task files, or target descriptions to ZCode for execution, supporting four modes:build / edit / plan / yolo. - Single-writer mutual exclusion: Uses
repo/memoryfile locks and an in-process FIFO queue to ensure tasks with the same lock execute serially; conflicting tasks queue up without errors, avoiding interference from concurrent multi-session operations. - Real-time monitoring: Displays each job’s status, elapsed time, context usage, exit code, and lock holder; supports pulling recent output (tail).
- Resume / Re-run: Supports re-sending the original prompt with
--resumewithin the same session, or sending new instructions in the same session. - Channels and fallback chains: Supports switching plan channels / models; when quota is exhausted or not activated, automatically hands over and re-runs according to the fallback chain.
- Free quota channel: Supports ZCode Start Plan (promotional quota), with channel ID
account:<family>-start-plan(e.g.,account:bigmodel-start-plan), displayed as “Free Quota (Start Plan)” in the panel. - Usage aggregation: The local ledger supports 5-hour rolling, this week, and today statistics, and displays remaining plan quota (marks
available:falsetruthfully when the data source is unavailable). - Dispatch master switch: A cross-session truth file; when set to
false, no session may dispatch. - Agent tools: Registers the
dispatchcommand, corresponding one-to-one with panel operations.
Configuration¶
Plugin fields are configured in cordis.patch.yml under the dispatch/ directory.
| Field | Default | Description |
|---|---|---|
demo |
false |
UI demo mode; uses built-in fake data for rendering and does not touch the dispatcher. |
maxConcurrent |
3 |
Maximum number of concurrent runs. |
runnerPath |
'' |
Absolute path to the runner script. |
ledgerPath |
'' |
Absolute path to the ledger dispatch-runs.jsonl; if empty, usage aggregation is skipped. |
workRoot |
'' |
Dispatcher working root directory (stores locks/, state/, logs/); if empty, falls back to the plugin directory .data/. |
switchPath |
'' |
Path to the dispatch master switch truth file; if empty, the switch is not writable. |
Note: If either runnerPath or workRoot is empty, the dispatcher will not be created. The panel falls back to demo mode, and agent tools return readable errors. This is intentional design—it does not silently run incorrectly.
Agent Tools¶
The plugin registers the dispatch tool, supporting the following subcommands:
dispatch | list | kill | dismiss | tail | quota | status | switch | channels | channel | retry | fallback
- dispatch: Dispatches tasks, with parameters including
kind(prompt/task/target),provider,mode,lock,cwd, etc. - list / tail(id,n): View the task list and output.
- kill(id) / dismiss(id): Terminate tasks and remove them from the list.
- quota: View usage.
- status / switch(enabled): Read or toggle the dispatch master switch.
- channels / channel / retry / fallback: Manage channels, retries, and fallback chains.
Notes¶
- Depends on ZCode CLI: The plugin does not store credentials itself, but reads ZCode CLI’s
~/.zcode/v2/config. If ZCode updates credentials without syncing them back toconfig, 401 errors may occur. - Free quota limitations: The free quota channel is time-windowed and does not support
--resume/--target/--memory-bench; the official MCP is unavailable within managed processes. - Differences from the sister project: This project provides independent ZCode processes and tool support; the sister project
dsh-connect-zcodeconnects the free quota as DSH’s model conversation channel, but the DSH tool layer is not involved (e.g.,browser_*, Agent Teams, etc.). If agent autonomous tool usage is required, prioritize using the dispatch panel.