AshenSeeker/dsh-subagent-switch ↗★ 2

@local/subagent-switch

DSH desktop plugin: routes every subagent to the best available local model — free-first, quota-aware, capability-matched — and adds a control panel next to the session model bar.

包名
@local/subagent-switch
兼容性
待验证
版本
0.1.1
许可证
MIT
最近更新
2026年11月6日

同名包的其他仓库

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:AshenSeeker/dsh-subagent-switch

从 GitHub 装(推荐给使用者)

cd           # 官方 profile 一般在 ~/.dsh/profiles/desktop
pnpm add "git+https://github.com/AshenSeeker/dsh-subagent-switch#v0.1.1"

然后在 /cordis.patch.yml 里插一行:

- insert:
    - id: '@local/subagent-switch'
      name: '@local/subagent-switch'

重启 DSH,左侧栏出现「子代理模型切换」。

用 tag 而不是 main,是为了你装到的版本不会随我后续提交变化。想跟最新就换成 #main。

配置

配置有两个入口,都认:

  • /cordis.patch.yml 里给本插件那行写 config:(扁平键值)
  • 或改插件的 config.example.json(嵌套在 "subagent-switch" 下)

两种形状都会被剥壳合并,最终交给路由器的永远是扁平对象。数组是替换不是追加 —— 写 [] 就是清空,想收窄不会被撑宽。

关键项

键默认说明
enabledtrue总开关
modelTiers["free","free_quota","paid"]分层顺序
cheapBand["free","free_quota"]合并成一个档带按能力排;[] 退回逐档走
escalateOnMisstrue便宜档无匹配时是否允许升付费档
escalateMinScore1升级要求的最低分(10 = 只认 required 域强匹配)
pricing{freeMultiplierMax:0, quotaMultiplierMax:0.15}价格倍率 → 档位阈值
tierMap{}把某个模型 id 显式钉到某档(最高优先级)
tags{}手写能力标签,键支持 provider/model / 裸 id / 显示名
blacklist[]移出候选池
excludedProviders内置 ["cline"]整 provider 排除,在发起 adapter 请求之前就跳过
requireQuotaAwaretrue路由门禁总开关
routableOverrides[]门禁的逐模型例外
autoRouteSubagentstrue是否拦截 startActivation 自动改模型
forceOverridefalse为 true 时连调用方显式指定的模型也改写
overridesPath""手动优先级文件位置,空 = ~/.dsh/subagent-switch-overrides.json

手动优先级文件

{
  "priority": { "workbuddy/glm-5.3": 2 },
  "routable": { "our-free-model/big-pickle": true }
}
  • 原子写(tmp + rename),写失败不影响运行时,只是重启后会丢(面板红字提示)。
  • 只用正向声明:0 和 false 都删键,文件里只看得到你真正做过的决定。
  • 删掉这个文件就全部回到自动。 插件绝不碰 DSH profile 的 cordis.patch.yml。