Introduction

The DeepSeek Harness plugin ecosystem emphasizes flexibility and extensibility. Handling multi-domain tasks in a single conversation flow, maintaining contexts for multiple different personas, or orchestrating complex pipeline workflows often requires frequently switching Agents or manually decomposing tasks. The dsh-agent-dispatch plugin provides a mechanism that allows users to define independent Agent subagents, supports automatic routing and priority switching, and enables dependency-driven orchestration through squad templates.

Core Features

This plugin mainly addresses the following problems:

  1. Custom Agents and Squad Orchestration: Users can fully customize the Agent’s system prompt, trigger domain, and persona, and define multi-step execution flows through squad templates.
  2. Automatic Routing and Model Priority Switching: Configure a model routing table for each Agent; if the preferred model fails, automatically switch to the next available model.
  3. Floating Activity Ball UI: Provides a floating ball resident in the bottom-right corner to quickly invoke runtime status, history, and the Agent list, enabling one-click delegation.
  4. Context Reuse and Follow-up: Supports follow-up questions to existing Agent sub-conversations, reusing context without creating a new one.

Installation

Installing this plugin requires a DeepSeek Harness environment. Register the source via the command line to enable it:

dsh plugin --profile <你的 profile 名> add github:kiligzzz/dsh-agent-dispatch

After installation, the data directory and configuration files are uniformly stored under the host configuration directory:

$DSH_HOME/data/dsh-agent-dispatch/
├── agents.json     # Agent 定义列表
├── squads.json     # 小队模板列表
└── dispatches.jsonl # 决策日志(上限 2000 行,自动轮转)

Configuration and Definition

After installation, the plugin is empty by default and requires user configuration.

Defining an Agent

Define Agents in agents.json. Core fields include id, triggers (trigger domain), routes (model routing), and systemPrompt (persona).

{
  "version": 1,
  "agents": [
    {
      "id": "log-tracer",
      "name": "线上排查员",
      "emoji": "🛠️",
      "triggers": "报错日志;订单异常;接口报错;线上问题排查",
      "systemPrompt": "……(完整 Agent 系统提示词 / persona)",
      "routes": [
        { "provider": "deepseek-official", "model": "deepseek-v4", "effort": "high" },
        { "provider": "kimi-coding", "model": "k3-256k", "effort": "high" }
      ],
      "enabled": true
    }
  ]
}
  • routes: Model priority table; if the first one fails, automatically switch to the next.
  • effort: Controls compute effort; supports minimal/low/medium/high/xhigh/max.
  • triggers: When a user message matches these keywords, the main Agent automatically triggers delegation.

Defining a Squad

Define squad templates in squads.json. The steps array defines execution steps, and dependsOn controls dependencies.

{
  "version": 1,
  "squads": [
    {
      "id": "my-squad",
      "name": "我的小队",
      "steps": [
        { "agentId": "log-tracer",   "phase": "日志", "dependsOn": [], "instruction": "{input}" },
        { "agentId": "sql-analyst",  "phase": "数据", "dependsOn": [], "instruction": "查表核对:\n{input}" },
        { "agentId": "code-reviewer", "phase": "审查", "dependsOn": [0, 1], "instruction": "基于日志+数据:\n{input}\n\n【日志结论】\n{prev:0}\n\n【数据结论】\n{prev:1}" }
      ]
    }
  ]
}
  • dependsOn: An empty array means the first batch runs in parallel; otherwise, it waits for preceding steps to complete.
  • instruction: Supports {input} (the original goal) and {prev:N} (references the result of a preceding step).

Usage

The plugin provides 5 core tools, invoked by the main Agent:

  1. agent_dispatch(agentId, task): Delegates a task to the specified Agent and returns childId.
  2. agent_followup(childId, message): Follows up with an existing Agent, reusing context.
  3. agent_list(): Lists the Agent catalog for lookup before routing decisions.
  4. agent_squad(squad_id, goal): Expands a goal according to a squad template.
  5. agent_import_skill(skillDir?): One-click imports ~/.dsh/skills/<name>/SKILL.md as an Agent.

Trigger Mechanism

Users can trigger delegation in the following three ways:

  1. Automatic Conversation Routing: The task matches an Agent’s triggers, and the main Agent automatically calls agent_dispatch.
  2. / Trigger Menu: Enter / to invoke the candidate menu; after selection, the $id prefix is inserted.
  3. Floating Activity Ball: Click the floating ball in the bottom-right corner and select an Agent or squad card directly from the popup to delegate.

Explicit Specification

Explicitly specify the Agent ID in the user message using the $<id> prefix (for example, $log-tracer 查下 orders). After recognition, the main Agent delegates directly without routing decisions or follow-up.

Data and Logs

All delegation operations are written to the dispatches.jsonl file. The system uses mergeDispatchHistory to pair dispatch (start) and result (end) lines. To prevent log bloat, the file is limited to 2000 lines; when exceeded, it is automatically rewritten while retaining the tail.

Notes

  • No Built-in Content: After installation, the plugin is empty; Agents or squads must be created manually.
  • Zero Dependencies: Does not depend on @deepseek-ai/dsh-tools, avoiding the official dual-instance bug.
  • Single-Use Recommendation: It is recommended to use only one delegation system (such as this plugin). Avoid using it simultaneously with other team-lead style plugins such as dsh-agent-teams to avoid redundant subagents.
  • Plugin Directory: https://www.skillhub.cn/plugins/kiligzzz/dsh-agent-dispatch
  • GitHub Repository: https://github.com/kiligzzz/dsh-agent-dispatch