Introduction¶
In DeepSeek Harness (DSH), some tasks can be broken down into multiple independent subtasks. Processing them one by one serially makes batch dispatching and status observation less intuitive.
dsh-kimicode-swarm addresses this scenario by porting the Kimi Code Swarm mode to DSH, providing the swarm_batch tool, /swarm command, and real-time progress bars in the chat. It is maintained by hongyue0721 and licensed under MIT.
The following section introduces its core capabilities, installation, typical usage, and known limitations.
What is it¶
dsh-kimicode-swarm is a DSH plugin for batch parallel sub-Agent scheduling.
Its core workflow is: the Agent judges whether a task is worth splitting, uses swarm_batch to generate subtasks in bulk, sub-agents execute in parallel, and the running status is displayed in the chat. The /swarm command is used to enter Swarm mode once, completing boundary exploration, decomposing subtasks, batch dispatching, and aggregating results before automatically exiting.
Core Capabilities¶
The swarm_batch Tool¶
swarm_batch uses prompt_template + items to generate subtasks in bulk, with a maximum of 128 items.
Each item in items can carry model or type. If a task has been started before, resume_agent_ids can be used for resume.
swarm_batch parameters include:
descriptionsubagent_typemodelprompt_templateitemsresume_agent_ids
When specifying the model per task, you can write for a specific item:
{
"item": "...",
"model": "deepseek-v4-pro"
}
You can also pass the model field for the entire batch.
The model assignment order is as follows:
item-level or whole-batch explicitmodeltakes priority.- Next, it matches against the configured mapping table based on
type. - Finally, it inherits the caller’s model.
Adaptive Scheduling¶
The scheduler starts with 5 concurrent tasks and ramps up by 1 every 700ms.
When encountering rate limits, it performs exponential backoff, such as 3s, 6s, 12s. The scheduler capacity can shrink or recover.
Cancellation behavior is as follows:
- When a user cancels, completed results are preserved.
- A single task timeout only fails that specific task.
The /swarm Command¶
/swarm <task> is a one-shot Swarm mode used for:
- Exploring boundaries.
- Decomposing subtasks.
- Batch dispatching.
- Aggregating results.
- Automatically exiting the mode.
Example:
/swarm 审查这三个模块的代码并给出修复建议
Real-time Progress Bars in Chat¶
The host broadcasts full snapshots via SSE /swarm-events, the browser subscribes using EventSource, and renders running, queued, and completed states.
Progress is only for display and is not written to session logs.
Installation and Activation¶
First, install the plugin:
dsh plugin --profile web add dsh-kimicode-swarm
After installation, restart dsh web:
dsh web
In new sessions, you can see the swarm_batch tool and /swarm command.
Since the plugin integrates into the current DSH environment and registers tools and commands, you should check the source code and license before installation.
Typical Usage¶
- Directly describe the task and let the Agent judge if it’s worth batching; or explicitly ask to “use swarm for batch dispatch”.
- Use a shortcut command to initiate a one-shot Swarm mode:
/swarm 审查这三个模块的代码并给出修复建议
- Specify the model per task: write for a specific item in
items:
{
"item": "...",
"model": "deepseek-v4-pro"
}
You can also pass the model field for the entire batch.
Configuration¶
Configuration can be done via the entry config of a profile patch or the swarm: section in ~/.dsh/settings.yaml.
Provided configuration items include:
enabledannounceToAgentmodelMappingEnabledmodelMapping
Example structure is as follows:
swarm:
enabled: true
announceToAgent: true
modelMappingEnabled: false
modelMapping:
- type: <type>
model: <model>
Here, modelMapping is used to match against the mapping table based on type. When a model is not explicitly specified, it will finally inherit the caller’s model.
Known Limitations¶
- Settings page cards are limited by the host whitelist: the hardcoded whitelist
WEB_SETTINGS_NAMESPACESindsh-host-apiproxycauses the plugin’s self-registered settings namespace to returnsettings-not-exposed; GUI editing is enabled once the host relaxes the restrictions. - Intermediate tokens are not reported during sub-agent execution; the progress bar only shows start/completion status, not token-level streaming.
- No file lock: conflicts from multiple sub-agents writing are avoided by task decomposition.
- Progress is only for display and is not written to session logs.
Summary¶
dsh-kimicode-swarm is suitable for handling tasks in DSH that are decomposable, parallelizable, and require dispatching sub-agents in bulk. It provides the swarm_batch batch tool, the /swarm one-shot command, and progress display in the chat, making it suitable for developers who wish to dispatch sub-agents in parallel and observe their status.
Related Links¶
- GitHub: https://github.com/hongyue0721/dsh-kimicode-swarm
- Directory Page (from plugin lead, not independently verified): https://www.skillhub.cn/plugins/hongyue0721/dsh-kimicode-swarm