DSH 修理插件(dsh-repair-plugins)
两个修补 DSH 体验缺口的小插件,一个仓库管理。它们都不是通用工具,而是针对具体缺口的补丁: 装了就生效,卸了就恢复,不碰会话数据与模型输入。
实测基线:DSH desktop 0.2.2-rc.5(Node ≥ 20)。MIT。
| 包 | 修的是什么缺口 | 类型 |
|---|---|---|
dsh-ask-guard |
提问会在用户看到之前被超时掐断 —— ask_user_question 自己没有超时参数,等待预算完全由外层 run_code 的 timeoutMs 决定(默认 120000 ms = 2 分钟) |
宿主插件(挂 tools/pre-execute) |
dsh-hide-context-rows |
对话流里每条 上下文注入 · <producer> 折叠行(time-context / ptc-mode 等),核心没有开关 |
纯客户端插件(只改渲染) |
安装
两个插件都用 link 三件套装进档案(%USERPROFILE%\.dsh\profiles\desktop),缺一件升级时会被回收:
node_modules里建目录联接(Junction);- profile 的
package.json写"<包名>": "link:<本仓库包目录的绝对路径>"; - 在档案目录跑
pnpm install落进pnpm-lock.yaml。
dsh-ask-guard
自带安装脚本(会备份 package.json、写 bundles、建联接、落 lockfile):
node packages/dsh-ask-guard/scripts/install.mjs --dry-run
node packages/dsh-ask-guard/scripts/install.mjs
node packages/dsh-ask-guard/scripts/uninstall.mjs
它还会要求在 profile 的 cordis.patch.yml 里把 ptc-runtime 的 maxTimeoutMs 抬到 780000 —— 否则 720000 的预算会被 clamp 回 10 分钟。
dsh-hide-context-rows
手动三步(该包没有 install 脚本,故意保持最小):
# profile 的 cordis.patch.yml —— 必须走 insert 列表
- insert:
- id: hide-context-rows
name: dsh-hide-context-rows
config: {}
不能写成顶层
- id: … name: …:那是「覆盖已有条目」的语法,目标 id 不存在时 Loader 只 warn 后静默跳过(2026-11-14 实际踩过)。
然后建联接、写 link: 依赖、pnpm install,并重启 DSH(客户端模块清单在宿主启动时生成,F5 刷新不带新客户端插件)。
验证
# 1) ask-guard:拦截生效 + 审计在写
Get-Content "$env:USERPROFILE\.dsh\logs\ask-guard.jsonl" -Tail 3
# 2) hide-context-rows:页面自证(生效时)
# document.documentElement.dataset.dshHcr === 'on'
# 或 DevTools 里看 <html data-dsh-hcr="on" data-dsh-hcr-count="N">
dsh-hide-context-rows 的判据是行内 [data-context-source] 与 [data-disclosure-header],
DSH 升级后可能改名;改名后插件会静默失效(行重新出现,宿主日志照旧正常)。
可用本机工具快速核对:
node C:\Users\27096\.dsh\tools\dsh-session-archaeology\check-client-selectors.mjs `
dsh-client-ui-chat data-context-source data-disclosure-header ContextInjectionRow
文档
这两份清单是从本机实机验证里长出来的,跟插件一起维护:
| 文档 | 内容 |
|---|---|
| 新机插件安装清单 | 在一台新机器上装 DSH 插件:必装 9 个、推荐扩展、必须禁用的、私有 link 插件、验证四步、已知坑 |
| 插件故障与复检清单 | 哪些插件会被 DSH 升级搞坏、怎么修、修复脚本在哪、升级后 5 分钟自检 |
两份都以 DSH 0.2.2-rc.5 为基线,版本号是 as-built 值。
目录
dsh-repair-plugins/
packages/dsh-ask-guard/ 提问预算闸门
lib/index.js 判定逻辑(tools/pre-execute)
scripts/install.mjs 装/卸(三件套)
cordis.patch.yml loader entry + 默认 config
tests/ e2e/ 单测与真运行时 e2e
packages/dsh-hide-context-rows/ 隐藏「上下文注入」行
lib/index.js 宿主半(空壳,写 activation breadcrumb)
lib/client.js 客户端半(CSS :has() + MutationObserver)
cordis.patch.yml loader entry(insert)
两个已知边界
- ask-guard 只看得到经过 DSH 工具层的调用;原生(非 PTC)模式提问会直接阻塞,不受它管辖。
- hide-context-rows 只改渲染:轨迹页、会话事件、发给模型的内容都不变。副作用是同一 DOM 判据画出的其他行(如「工具已更新」「跨会话召回」)也可能被一并隐藏;要收窄可以在
client.js里按 producer 名过滤。
English
Two small repair plugins for DeepSeek Harness (DSH), tested on 0.2.2-rc.5:
- dsh-ask-guard — enforces that an
ask_user_questionrequest carries a full 12-minuterun_codebudget (timeoutMs: 720000); otherwise it rejects the call attools/pre-execute. Without it, questions are cancelled by the default 2-minute run timeout before the user ever sees them. - dsh-hide-context-rows — a client-only plugin that hides the
上下文注入 · <producer>disclosure rows from the chat transcript (DSH renders injected runtime context as visible rows with no setting to turn them off). Rendering only: trajectory view, session events and model input are untouched.
Install: link-based (junction in the profile's node_modules + link: dependency + pnpm install); dsh-ask-guard ships scripts/install.mjs. dsh-hide-context-rows must be registered through an insert: entry and requires a host restart.
MIT licensed.
还没有评论,来写第一条。