子代理工具箱:把原生子代理下拉按使用批次折叠为 历史 / 今日 / 上次 / 本次 四组(本次常展开),支持行内/整组删除子代理会话,并让子代理模型名单实时生效(逐任务选模型);不改动原版头部。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:Kadima-code/dsh-subagent-toolkit
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。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
给 DeepSeek Harness(DSH)的子代理工具箱,三件事一起做:
- 分组折叠:把官方「子代理」下拉按使用批次收进 本次 / 上次 / 今日 / 历史 四组;
- 删除子代理:行内删单个、组标题删整组,删完计数同步;
- 模型同步:委派时可以逐任务指定模型,按你当前的子代理模型白名单实时校验。
不改原版头部、不新增入口——按钮、布局、原版悬停全部保持原样,插件只在原生下拉和委派链路上做增强。
一、分组折叠
按「使用批次」聚合(间隔 ≤ 120 秒算同一批):
| 分组 | 含义 | 默认 |
|---|---|---|
| 本次 | 最近一次使用子代理产生的那一批 | 始终展开(带「本次 N」标签) |
| 上次 | 上一次使用子代理产生的那一批 | 折叠 |
| 今日 | 今天其余批次 | 折叠 |
| 历史 | 今天之前 | 折叠 |
- 点分组标题即展开/收起;标题只显示「名称 + 条数」。
- 打开某个子代理会话时,它头部的上级/目录下拉也按同一规则分组。
- 数据未就绪或行序对不上时一律不折叠(fail-open),绝不误藏运行中的行。
二、删除子代理
- 行内:每行尾部「⋯」→「删除子智能体」,二次确认(运行中会先停止)。
- 整组:组标题右侧「⋯」→「删除本组(N 个)」,一次删一组,交互与行内一致。
- 删除后该行隐藏,顶部「N 个子智能体」计数立即同步(事件驱动,无轮询)。
- 安全性:只允许删除
origin=subagent的会话;校验会话目录在 sessions 根内、拒绝符号链接、删后确认目录消失;运行中默认拒绝、确认后才停止。 - 说明:会话文件是真删、不可恢复;父会话目录记录是官方 append-only 事件日志,无法删除,故被删行只在本机隐藏(换机器/清缓存可能重现)。
三、子代理模型同步
DSH 旧会话的「子代理模型白名单」在会话创建时就冻结了。本插件让每次委派都按当前设置校验:
subagent显式传provider/model/reasoning_effort→ 按当前设置白名单校验后生效,主对话可以每个任务换不同模型;- 白名单/模型目录是运行时读取:在设置里增删模型无需重启;
- 非法路由明确报错(fail-closed),不会静默退回父模型;
- 实现方式:只包
subagent的执行体(摘出显式参数经 AsyncLocalStorage 传给启动层)和subagents.startActivation,不改任何工具注册; - 一键关闭:插件目录建空文件
.model-sync-off(或环境变量DSF_MODEL_SYNC_OFF=1),重启后只禁用模型同步,其余功能照常。
截图
| 之前 | 之后 |
|---|---|
![]() |
![]() |
安装
方式一:npm(推荐)
npm i dsh-subagent-toolkit
然后把 dsh-subagent-toolkit 写进 profile 的 dependencies 与 dsh.profile.bundles(插件自带 cordis.patch.yml),完全退出 DSH 再打开。
方式二:一键脚本(仓库/发布包内 tools/install.cjs)
node tools/install.cjs --profile desktop
支持 --dry-run 预览、--uninstall 卸载,并会备份 profile 的 package.json。
方式三:Release zip —— 下载 dsh-subagent-toolkit-v0.0.6.zip,解压后按方式二安装。
改的是 host 半,安装/更新后必须完全退出 DSH(托盘退出)再打开,仅 Ctrl+R 不够。
兼容与限制
- 目标:DSH 0.2.1-rc.x(desktop profile)。
- 模型同步属对内核委派链路的适配,DSH 升级后需回归一次;卸载即恢复原生行为。
- 分组/按钮是往 React 托管的原生下拉里注入节点(隐身增强),官方大改版可能需适配。
- 被删会话的“幽灵行”只在本机隐藏(见上文删除说明)。
dsh-subagent-toolkit (English)
A subagent toolkit for DeepSeek Harness (DSH). Three things in one plugin:
- Grouped folding — the native "Subagent" dropdown is grouped by usage batch into Current / Previous / Today / History;
- Deletion — delete one subagent from its row, or a whole group from the group header, with the count kept in sync;
- Model sync — pick a model per delegation, validated against your current subagent model allowlist.
The original header, layout and native hover behaviour are untouched.
Features
- Folding: batches are derived from subagent creation time (≤120s = one batch). "Current" is always expanded and labelled; the others collapse on click. Works inside a subagent session's own header dropdown too. If the DOM order cannot be matched, nothing is folded (fail-open) — running rows are never hidden by mistake.
- Deletion: row-level
⋯ → Delete subagent, and group-level⋯ → Delete group (N); running sessions are stopped first after confirmation. Onlyorigin=subagentsessions can be deleted; the session directory must live under the sessions root, symlinks are refused, and deletion is verified afterwards. Session files are really removed (irreversible). Because the parent's catalog is an append-only event log, the deleted row is hidden locally only. - Model sync: an explicit
provider/model/reasoning_effortonsubagentis validated against the current allowlist in settings, so the main agent can use a different model for every task. Settings are read at runtime — adding/removing models needs no restart. Invalid routes fail closed with a clear error. Only thesubagentexecutor andsubagents.startActivationare wrapped; no tool registration is touched. Kill switch: create an empty.model-sync-offfile in the plugin directory (or setDSF_MODEL_SYNC_OFF=1).
Install
npm i dsh-subagent-toolkit
Add dsh-subagent-toolkit to the profile dependencies and dsh.profile.bundles (the package ships its own cordis.patch.yml), then fully quit and reopen DSH.
Or use the bundled installer:
node tools/install.cjs --profile desktop # supports --dry-run / --uninstall
Or download dsh-subagent-toolkit-v0.0.6.zip from Releases and run the installer above.
The host half changes on install/update, so a full DSH restart is required (Ctrl+R alone is not enough).
Compatibility & limitations
- Targets DSH 0.2.1-rc.x (desktop profile).
- Model sync adapts internal delegation plumbing; re-check after a DSH upgrade. Uninstalling restores native behaviour.
- Folding/buttons inject nodes into React-managed dropdowns; a major upstream UI change may need adaptation.
- Deleted rows are hidden locally only (see above).
License
BSD-3-Clause
链接
同类插件
zhu1090093659/dsh-web#packages/dsh-task-board★ 9262
侧边栏多列任务看板:卡片交给真实 DSH 智能体会话执行,支持 cron 定时(Host 侧到点执行,关浏览器也生效)。
zhu1090093659/dsh-web#packages/dsh-web-all★ 9262
DSH Web UI 插件与皮肤合集:任务看板、git 图、右侧面板、远程移动端 UI、桌宠、实时 token 统计与皮肤中心。
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 5677
右下角常驻的小鲸鱼挂件:余额、今日已用与每轮对话消耗(含峰谷价),余额预警与今日预算的泡泡内容都可编辑;泡泡点击序列模块化自定义,支持并列加权 A/B、随机台词与随机图片;内置 30+ 厂商模板(OpenAI / OpenRouter / Kimi / 硅基流动 / 方舟 / 智谱 / MiniMax 等),按模型查余额与订阅额度;另有任务结束音效、导入音频、自定义角色与资源管理。数据全在本机,无遥测。
ccch1mneyyy/dsh-TUI★ 5125
Claude Code 风格全屏终端 UI:像素鲸鱼顶栏、实时工作状态行、思考流式展开。
omdsh-dev/DSH-better-sidebar★ 4413
侧边栏完整工作台:内置文件渲染编辑、终端、Git 与子代理,支持三方插件注册新 Tab。
Devin-AXIS/deepseek-design#deepseek-idesign★ 1491
可视化设计工作室,支持网站、App 原型、海报、信息卡、报告和杂志的模板创建、元素编辑、选区级 AI 草稿衔接与导出。


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