Asowerp/dsh-smart-subagent ↗★ 0
dsh-smart-subagent
Adds a model parameter to the subagent tool so the model picks the subagent's provider/model per call
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Asowerp/dsh-smart-subagent说明文档
阅读完整 README ↗dsh-smart-subagent
给 subagent 加一个独立的 smart_subagent 工具,带 model 传入参数:模型每次派发时自己决定用哪个模型,不需要任何自动路由。内置 subagent / subagent_fork 完全不动,照常使用。
效果
- 新增工具
smart_subagent,参数:model(可选,枚举当前全部可用模型,值形如deepseek-official/deepseek-v4-pro、my-gateway/gpt-4.1);省略 = 继承当前会话模型。reasoning_effort(可选:off/minimal/low/medium/high/xhigh/max;仅当所选模型支持时生效)。
- 前台、后台(continuable)子代理都按传入模型运行;后台跑完后
send_message继续时模型保持不变。 - 模型列表与 composer 选择器同源(当前已注册 provider 的模型),provider/模型变化后工具枚举自动刷新。
- 插件会注入一段系统提示,说明
smart_subagent的 model 参数用法;每个新对话的模型都能看到。
安装
dsh plugin --profile web add "link:/dsh-smart-subagent"
(或:物理复制进 \profiles\node_modules\dsh-smart-subagent,再把 "dsh-smart-subagent" 加进 profiles/web/package.json 的 dsh.profile.bundles。)
安装后重启 web。
配置
全部有默认值,cordis.patch.yml 里只列了常用项:
- id: smart-subagent
name: 'dsh-smart-subagent'
config:
providerName: smart # ctx.subagents 里的 provider 名
toolName: smart_subagent # 独立工具名(内置 subagent 不受影响)
maxDepth: 3
enableRunInBackground: true
backgroundMode: continuable # 或 one-shot
section: true # 是否注入系统提示说明
测试
node test/model-args.test.mjs(纯函数)node test/smoke-index.mjs(需能解析 profile 的 node_modules,开发时用 junction)