By default, DSH subagent invocations inherit the parent session’s model (such as Pro). When subagents perform lightweight tasks such as searching or summarizing, continuing to use the Pro model generates unnecessary cost. The dsh-delegate-router plugin solves this problem: when a subagent invocation occurs, it automatically routes lightweight tasks to the Flash model and keeps heavy tasks on the Pro model based on task characteristics, without relying on model cooperation, and logs the resulting decisions.

Positioning

  • Name: dsh-delegate-router
  • Maintainer: penguin-oo
  • Category: Model inference
  • License: MIT
  • Core value: Automated routing strategy for subagent tasks, reducing inference cost.

Core Features

  • Automatic routing: Route lightweight subagent tasks to the Flash model and retain heavy tasks on the Pro model.
  • Custom rules: Supports configuring routing policies via keyword lists, budget caps, short task thresholds, etc.
  • Manual override: Supports the /delegate command to manually adjust the routing policy for the current session.
  • Decision logs: Provides a dispatch record panel for viewing routing decisions in the current session.
  • Ecosystem compatibility: Compatible with dsh-routing-suite.

Installation

Use the official install command to add the plugin:

dsh plugin --profile web add dsh-delegate-router

Configuration and Usage

Runtime Commands

The plugin provides the /delegate command to control routing behavior for the current session:

  • /delegate auto: Enable automatic routing.
  • /delegate off: Disable routing (restore default behavior).
  • /delegate flash-all: Force all subagents to use the Flash model.
  • /delegate status: View currently active routing rules.

Configuration File

All configurable items are located in ~/.dsh/dsh-delegate-router.json. Configuration changes take effect on the next dispatch and do not require restarting DSH.

{
  "flashProvider": "opencode-go",
  "flashModel": "deepseek-v4.1-flash",
  "proProvider": "opencode-go",
  "proModel": "deepseek-v4-pro",
  "mode": "auto",
  "lightKeywords": ["search", "搜索", "查找", "总结", "summarize", "list", "列出"],
  "heavyKeywords": ["refactor", "重构", "implement", "实现", "debug", "调试"],
  "shortTaskMaxChars": 120,
  "peakDemoteUnknown": true,
  "unknownToFlash": false,
  "peakHours": [[9, 12], [14, 18]],
  "budgetCapTokens": 0
}

Configuration notes:
* shortTaskMaxChars: 0 disables the short task rule.
* peakDemoteUnknown: false disables the peak-period demotion rule.
* unknownToFlash: true is aggressive mode and routes all unmatched tasks to Flash (enable carefully).
* budgetCapTokens: 0 disables budget caps.

Notes

  • Effective timing: After modifying the configuration file, changes take effect immediately on the next subagent dispatch; no DSH process restart is required.
  • Price difference: The Flash model is fixed at one-third the price of the Pro model.
  • Default behavior: If no rule matches and unknownToFlash: true is not enabled, the task does not use Flash by default; instead, it inherits the parent model.

Summary

This plugin helps users run subagent tasks at lower cost in DSH through automated model routing. For scenarios that require frequent subagent invocations and are cost-sensitive, it is recommended to use it together with dsh-routing-suite.