dsh-subagent-toolkit: Specify third-party models for individual DSH sub-agents

Foreword

In DeepSeek Harness (hereinafter referred to as DSH), the sub-Agents created by the subagent tool follow the same model routing as the main Agent by default. If you want to connect to a third-party model, the common approach is to simply replace the main model—this binds both the main conversation and the sub-agent to the same model, making “Main Model A + Sub Model B” impossible.

dsh-subagent-toolkit fills this gap in flexibility: it does not require modifying DSH source code, does not replace the DeepSeek Account, does not affect the main conversation, and simply specifies a separate third-party model for the sub-agent. The plugin is maintained by leotpp, categorized as “Model Inference” in the community directory, current version 0.2.0, license MIT.

Below is an introduction to its capabilities, installation methods, and points to note during use.

What is it

One-sentence positioning: A DSH plugin that provides a “Settings → Sub-model” page, decoupling the sub-model from “following the main model” to a fixed independent routing.

Native DSH has two model chains:

Chain Purpose Determined by
Main Model Main conversation, Main Agent agent-default-model
Sub-model Sub-Agents created by subagent Default value of tool-subagent / Parent Agent routing; optional subagent-model-selection-settings

Native logic has two limitations:

  1. The sub-model defaults to inheriting the main model; when subagent does not explicitly pass provider/model, the sub-Agent shares the same routing as the parent Agent.
  2. subagent-model-selection-settings is disabled by default. When enabled, it only allows the main Agent to choose a model from a list for each subagent call, not a fixed default value. The native Plugins → Subagent page only allows checking authorization; it cannot add OpenAI compatible channels, fetch models, or set model parameters on the same page, nor is there a “Fixed Sub-model” option.

Therefore, when connecting to a third-party model directly, the sub-model mechanism is essentially hardcoded to “follow the main model”.

Core Features

  1. Settings → Sub-model Page: Add OpenAI compatible channels (Base URL, API Key), fetch model lists, select a single sub-model; or keep “follow main model”.
  2. Write to Official Settings: Saves as subagent-model-selection-settings = { enabled: true, allowedModels: [{ provider, model }] }, and synchronously writes to the channels and model parameters (context window, max output, reasoning intensity) of llm-pi-ai.providers.
  3. System Prompt Guidance: When the allowed list has exactly one route, inject a reminder into the main Agent so that when dispatching a subagent, it explicitly carries provider, model, and reasoning_effort. This ensures the fixed sub-model takes effect in new sessions, not just being written in the config.
  4. Optional subagent_pi: Uses the official Pi CLI to execute sub-tasks in a single process, completely independent of DSH’s in-process sub-Agents; does not load PI Desktop’s Maker, nor does it trigger codex exec.

The plugin does not modify the DSH kernel; it uses DSH’s official bundle/config extension mechanism. The native Plugins → Subagent page (recursion depth, concurrency, model authorization) remains usable, and they coexist.

Runtime routing priority is: subagent call explicitly passed provider/model/reasoning_effort (must be in Session allowlist) > tool-subagent.agentOptions default deployment > Parent Agent’s main model.

Installation

First choose an installation source according to team habits, then execute the command. Installation commands are from the README; when not using the npm-published format (which currently has no npm release notes yet), use a local path or a packaged tgz.

Local path:

dsh plugin --profile desktop add /absolute/path/to/dsh-subagent-toolkit

Or use a packaged tgz from the repository:

dsh plugin --profile desktop add ./dist/dsh-subagent-toolkit-0.2.0.tgz

The README also provides the syntax for when published to npm:

dsh plugin --profile desktop add dsh-subagent-toolkit

After installation, open Settings → Sub-model.

Compatibility: DSH requires >=0.2.1-rc.5 <0.3.0, verified on 0.2.1-rc.5; Client requires Web platform (dsh.client.platform: web), i.e., the Web GUI of the Desktop App; Pi CLI is optional, pi needs to be in PATH, or configured with an absolute path in subagent-pi.binPath.

Typical Usage

  1. Select Channel: Use an existing channel, or click “Add OpenAI compatible channel” and fill in Base URL and API Key.
  2. Fetch Models: Click “Fetch Models” and select one from the returned list.
  3. Select only one model and save: After saving, it will write enabled=true + allowedModels=[that route]; to restore “follow main model”, simply save without selecting a model.
  4. Open a new session: Settings are only sampled when the Agent is created; after saving, open a new session (or restart DSH).
  5. Optional Pi CLI: Configure subagent_pi in the Advanced area at the bottom of the page.

After the above steps, the main model remains A, and the sub-Agent created by subagent uses B. To verify, save and check subagent-model-selection-settings in ~/.dsh/profiles/desktop/cordis.patch.yml, then open a new session to trigger a subagent and confirm the sub-session uses the specified model.

How it Works

The plugin consists of two halves:

File Runtime Location Purpose
client.js Browser (DSH Web GUI) Settings → Sub-model Page: channels, model directory, unique sub-model, Pi CLI advanced items; writes to official config namespace via configForms
index.js Host Registers pi-cli sub-agent provider (subagent_pi); reads subagent-model-selection-settings, injects system prompts when exactly one route exists
cordis.patch.yml Host startup layer bundle patch: inserts two entries for subagent-pi and tool-subagent-pi
package.json — DSH bundle manifest, declares engines.dsh and client injection

There are two key points on the DSH side to remember when using:

  • subagent-model-selection-settings is a setting sampled by the Host when the Agent is created; it only takes effect for new sessions after saving, not retroactively for old sessions.
  • The subagent tool only switches to the sub-route when the Session has an allowlist and the call explicitly passes provider + model; when parameters are not passed, it still follows tool-subagent.agentOptions / Parent Agent routing.

Regarding configuration priority, the plugin does not outrank the official: DSH’s loading order is built-in bundle layer → plugin bundle layer → profile’s cordis.patch.yml → home-level cordis.patch.yml (highest). The plugin only inserts its own two entries and does not overwrite official entries. The plugin’s settings page and the official Plugins → Subagent page edit the same namespace subagent-model-selection-settings; whichever is saved last takes effect; revision validation in the page only prevents concurrent editing on the same page.

Applicable Scenarios and Notes

Suitable for teams where the main conversation is already fixed on a preferred model, but want sub-agents’ batched tasks (retrieval, cleaning, formatting, etc.) to use another third-party model to reduce cost or change behavior; or those who have already integrated OpenAI compatible channels and need a sub-model entry that does not intrude on the main chain.

Please confirm the following points before installation and use:

  1. The plugin runs with the permissions of the current dsh process. The channels, API Keys (stored via DSH credential service, not echoed in the settings page), and model parameters it saves will all fall into the local DSH configuration. Read index.js / client.js / cordis.patch.yml once before installation to confirm the behavior matches expectations. License is MIT.
  2. Fixed sub-model is a soft constraint, not enforced by the kernel. It relies on system prompts to remind the main Agent to pass parameters; if the model does not comply, it may still fall back to the main model routing. If a hard default is needed, please also set tool-subagent.agentOptions and verify the stacking effect with the model’s self-selection.
  3. Only affects new sessions. Old sessions will not be updated.
  4. Invalid routing will cause errors. After deleting or renaming a channel/model, the saved allowlist will point to a non-existent route, causing subagent calls to fail; simply return to the settings page, re-select, and save.
  5. Upgrades may break functionality. The plugin depends on DSH extension points configForms, settings.section, llm-pi-ai.providers, and subagent-model-selection-settings. After upgrading DSH to 0.3.x, the bundle may be skipped due to engines.dsh mismatch (settings page disappears), or client API changes may render the page unusable. Keep old dist/*.tgz versions before upgrading for rollback; after upgrading, verify the settings page and one delegation according to the self-check steps in the README.
  6. Entry ID conflicts. If the subagent-pi / tool-subagent-pi inserted by the plugin conflicts with future official entries, the Loader will report duplicate IDs; at that time, you will need to change the ID or use official capabilities.
  7. Pi CLI is an external process. subagent_pi will execute the local pi binary, does not inherit the parent session context and DSH Session records, and only installs from trusted sources. When pi is not installed, only subagent_pi is unavailable, and the native subagent is not affected.

Closing

The value of this plugin lies in decoupling the “main model” and “sub-model” chains, allowing sub-agents to use independent third-party models while retaining DSH’s native settings page. Installation is dsh plugin --profile desktop add ./dist/dsh-subagent-toolkit-0.2.0.tgz, after installation, just configure a unique model in Settings → Sub-model.

Directory page: https://www.skillhub.cn/plugins/leotpp/dsh-subagent-toolkit

GitHub: https://github.com/leotpp/dsh-subagent-toolkit

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye