DeepSeek Harness 插件

lucagiftzek/dsh-subagent-tiering

Star 数 ★ 0 下载量(近 30 天) 180 分类 模型与账号接入 收录于 2026-11-02 npm @lucagiftzek/dsh-subagent-tiering

为未指定 provider/model/effort 的 subagent 调用补上更便宜的同类路由(例如 Opus → Sonnet 5.5 @ medium、Qwen max → Qwen flash);显式指定的选择与 subagent_fork 保持不动。需在设置里启用 subagent-model-selection 且目标路由在其 allowedModels 中,否则插件不产生任何效果。

安装

# npm 包(预构建)

dsh plugin --profile web add @lucagiftzek/dsh-subagent-tiering

# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)

dsh plugin --profile web add github:lucagiftzek/dsh-subagent-tiering

装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。

README

该插件的 README 只有英文版本。

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

How a subagent call gets a cheaper sibling route

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.enabled is true, so chats that predate 2026-09-27 are not affected;
  • the target route is not in that policy's allowedModels;
  • llm.resolveCallConfig rejects 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 entry subagent-model-selection-settings and is not imported from an old settings.yaml (see docs/TROUBLESHOOTING.md).
  • the ptc / ptc-lean preset's tool-subagent row with modelSelectionSettings: true (stock).
  • adaptive-reasoning must NOT list anthropic/claude-sonnet-5-5 (or claude-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-doctor skill (copy skills/subagent-tiering-doctor into ~/.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.

内容来自项目 README(GitHub)↗

链接

同类插件

查看整个分类 →

社区评论

评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。