dsh-subagent-tiering
Manifest validFills in a cheaper sibling route for subagent calls that name no provider, model or effort (for example Opus to Sonnet 5.5 at medium, Qwen max to Qwen flash); explicit choices and subagent_fork are le
dsh-subagent-tiering
Subagents run on a cheaper sibling of the parent model unless the agent names a route.
dsh plugin --profile web add @lucagiftzek/dsh-subagent-tiering
# or from GitHub: dsh plugin --profile web add github:lucagiftzek/dsh-subagent-tiering
# then restart dsh web

Subagents run on a cheaper sibling of the parent's model unless the main agent names a route itself.
Install
Install from npm: dsh plugin --profile web add @lucagiftzek/dsh-subagent-tiering, or from GitHub: dsh plugin --profile web add github:lucagiftzek/dsh-subagent-tiering.
dsh plugin --profile web add @lucagiftzek/dsh-subagent-tiering
# or from GitHub: dsh plugin --profile web add github:lucagiftzek/dsh-subagent-tiering
# then restart `dsh web`
The package declares dsh.bundle, so dsh plugin add lists it in dsh.profile.bundles and
its own patch inserts the subagent-tiering entry with the built-in rules. A local checkout
works too: dsh plugin --profile web add link:/absolute/path/to/dsh-subagent-tiering.
Requires Node 22.18 or newer; used on DSH 0.1.5 and 0.2.1. Read "Needs" below: without a
subagent model-selection policy the plugin changes nothing.
| Parent route | Child default |
|---|---|
| anthropic Opus / Fable / Sonnet | anthropic claude-sonnet-5-5 @ medium (falls back to claude-sonnet-5) |
| alibaba Qwen max/plus | qwen3.8-flash @ high |
| alibaba / byteplus DeepSeek pro | the provider's DeepSeek flash @ high |
| byteplus GLM / Seed | glm-5-3-flash-260828 @ high |
| deepseek-official | deepseek-flash @ high |
| mistral large | mistral-medium-latest |
| any other mistral, alibaba GLM, hetzner | same model, effort capped at high (never raised) |
| anything else | inherits the parent, as stock dsh does |
vision-toolkit-<x> parents keep their wrapper provider. Rules live in
src/rules.js and can be overridden with a - id: subagent-tiering row in the
profile's cordis.patch.yml (config.rules, same shape).
A rule's child.fallbackModels (optional list of model ids, same provider and
effort) is tried in order when the primary model is not in the chat's captured
allow-list or does not resolve. 2026-09-29: the Anthropic default moved from
Sonnet 5 to Sonnet 5.5; chats created before that day have no Sonnet 5.5 in
their allow-list, so they keep getting Sonnet 5 instead of inheriting Opus.
Why (2026-09-27)
Over 14 days of session logs on one busy install, 70% of dsh's Anthropic calls were
subagents. The stock ptc preset gives subagent no child defaults, so every
child ran on the parent's route and effort (usually Opus 5.5 at max). Per human
prompt, dsh cost 2.1x what Claude Code did on the same box, while per call the
two were about equal. tool-subagent's own agentOptions is one static route
and cannot express "Opus parent → Sonnet child, Qwen parent → Qwen-flash child".
How it works
A tools/pre-execute handler. When a subagent call names no provider,
model or reasoning_effort, it fills them in from the first matching rule, as
if the model had asked. The stock tool then runs its normal checks. It leaves the
call untouched, so the child inherits the parent, when:
- the main agent passed any of the three fields itself (its choice always wins);
- the chat has no model-selection policy. dsh records one only for chats created
while
subagent-model-selection.enabledis true, so chats that predate 2026-09-27 are not affected; - the target route is not in that policy's
allowedModels; llm.resolveCallConfigrejects the route. If it rejects only the effort, the effort is dropped and the route kept;- core dsh ever freezes the execution record. This is logged once.
subagent_fork is never touched. A fork must stay on the parent route to reuse
its cached prefix.
A short system-prompt section (subagent-tiering, about 90 tokens) tells the
model about the default and how to override it.
Trade-off
A child on a different model cannot reuse the parent's prompt cache, so its first call pays a full cache write (about 48k tokens on Anthropic after the GenUI removal). A one-call subagent can therefore cost slightly more than before. The median subagent here makes 28 calls, so it comes out well ahead.
Needs
- settings
subagent-model-selection: { enabled: true, allowedModels: [...] }. On DSH 0.2.x this harness setting lives under the entrysubagent-model-selection-settingsand is not imported from an oldsettings.yaml(see docs/TROUBLESHOOTING.md). - the
ptc/ptc-leanpreset'stool-subagentrow withmodelSelectionSettings: true(stock). - adaptive-reasoning must NOT list
anthropic/claude-sonnet-5-5(orclaude-sonnet-5, the fallback) among its routes, or it would override the child's medium effort on every step.
Verify
node --test test/*.test.js runs the unit tests. End to end: start a new chat on
Opus 5.5 and have it call subagent with no model. The child session's
request/header shows claude-sonnet-5-5 / medium (was claude-sonnet-5
until 2026-09-29). Checked on 2026-09-27 on
a production install (Opus → Sonnet) and in a sandbox (Qwen max → Qwen flash; an explicit
qwen3.8-max @ low was left as asked).
When something goes wrong
- Ask your agent to load the
subagent-tiering-doctorskill (copyskills/subagent-tiering-doctorinto~/.dsh/skills/once, how). - Symptom-first guide: docs/TROUBLESHOOTING.md.
- Log lines and start-up messages: docs/ERRORS.md.
More plugins by the same author
All of them are open source and run on DeepSeek Harness 0.2.x (several on 0.1.5 too).
| Plugin | What it does |
|---|---|
| dsh-artifacts | An Artifacts tab that lists the files an agent produced and previews them in place, plus a template library agents can use and extend |
| dsh-mail | Mail client and agent mail tools: IMAP, POP3, SMTP and OAuth2 accounts, scheduled and bulk sends with unsubscribe handling |
| dsh-note-keeper | Obsidian-compatible Markdown notes in the sidebar with search, graph, audio notes and transcription, OCR and client-side encryption |
| dsh-phone | SMS and calls (Twilio, SIP via Asterisk) with call audio through your own server, live voicemail and Telegram |
| dsh-voice | Read-aloud, dictation and language-aware speech with 23 TTS and STT providers, per-language routing and word highlighting |
| dsh-orchestrator | Agent swarm and task orchestration: an Orchestrate tab, orch_* tools, runners, provider cards and a machine API |
| dsh-workspace-rail | A workspace-first sidebar rail: pinned chats, projects as folders, live Recents, search and unread markers |
| DSH-Idle-Watchdog | Idle-chat nudges and an authenticated HTTP API that posts a prompt into any chat |
| dsh-plugin-updates | Update checker that only offers releases your running DSH core can load |
| dsh-subagent-tiering (this one) | Subagents default to a cheaper sibling of the parent model unless the agent names a route |
| dsh-fs-reobserve | Ends self-inflicted stale-file errors after an agent's own shell commands |
| dsh-request-image-cap | Clamps every image sent to the model to a pixel cap, fixing many-image request errors |
| dsh-seal | An encrypted channel in front of DSH: a Go reverse proxy plus a service worker that seal all DSH browser traffic |
Built by Luca Tzekos, who also makes Job Opportunities API: employer-direct job data with per-field provenance you can verify yourself, free to read and available as an API. If this plugin is useful to you, a star on this repo or a look at jobopportunitiesapi.org is the best thanks.
Comments
Loading…
Similar plugins
by shenzhantu
通过模型插件用来修改subagent所使用的模型和Agent预设/Use model plugins to modify the model used by the subagent and the agent presets.
★ 0
MIT
JavaScript
Aug 20, 2026
dsh plugin --profile web add dsh-subagent-modelby ringoage
The visual, manual subagent-model picker for DeepSeek Harness — predictable per-session routing with global coverage of every in-process subagent path, complementary to auto-routing plugins.
★ 0
MIT
JavaScript
Aug 16, 2026
dsh plugin --profile web add dsh-subagent-model-pickerDeepSeek Harness plugin: on task send, pick a different model for subagents and an independent reviewer that validates each subagent's work before it reaches the main agent
★ 0
MIT
TypeScript
dsh plugin --profile web add dsh-orquestratorby lincong1987
dsh plugin: flexible model switch for sub‑agent & plan execution. 为子代理和计划执行选择更合适的模型。
★ 11
↓ 2.8k/wk
MIT
TypeScript
Oct 23, 2026
dsh plugin --profile web add dsh-model-switchby kolawong
DSH plugin: pick separate models and reasoning efforts for the main session, subagents, and plan mode.
★ 0
MIT
TypeScript
Oct 17, 2026
dsh plugin --profile web add dsh-plugin-model-dispatchby bpc-oss
DeepSeek Harness plugin: subagent_routed — run a one-shot subagent fully mounted on ANY agent preset from ANY session, with per-call model/provider override and a model-availability pre-check.
★ 3
MIT
JavaScript
Sep 12, 2026
dsh plugin --profile web add dsh-routed-subagent