DeepSeek Harness plugin

dsh-pref-kit

DSH performance mitigation plugin: llm/stream chunk coalescing + emission rate limiting (regular), and experimental trajectory-view replacement / chat rendering hints, with a Settings -> Plugins

Jump to install

Source facts

Repository
gameswu/dsh-pref-kit
Latest update
Aug 17, 2026
Category
Tools & Capabilities
GitHub stars
4
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/gameswu/dsh-pref-kit
Plugin: dsh-pref-kit
Author: gameswu

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

dsh-pref-kit

DSH 性能插件:在数据流源头合并模型流式输出的相邻文本增量,减少会话事件量, 缓解长会话与多 agent 并发下的卡顿与资源占用。不改任何接口与协议。

功能

  • 流式合并(默认开启):把同一文本块内的相邻 text/reasoning 增量合并后再写入

会话日志与推送,事件量下降 11–56%(短回复 −45.6%、长回复 −53.5%、6 并发 −55.6%, 复杂长会话 −11%),内存 / 磁盘 / 带宽同步下降;windowMs = 0 即完全透传, 与未装插件逐事件等价。

  • 设置卡片:Settings → Plugins 提供配置卡片(与内置卡片同款样式),修改保存后

即时生效、跨重启保留。

  • 实验开关(默认全关)

- 替换轨迹视图:用轻量轨迹页接管官方轨迹入口(需先禁用官方 ui-trajectory 行), 消除轨迹页在流式期间的每帧全量重算(基准模型实测 ×239–×184.9k 工作降幅); - 聊天区渲染提示:让浏览器跳过视口外消息的绘制(画面不变); - 运行时行管理:按白名单禁用/启用官方插件行(如遥测、token 统计),即时生效并持久化。

安装

cd dsh-pref-kit
npm run build                                       # 构建
dsh plugin --profile web add "file:$(pwd)"          # 装入目标 profile(自动挂载插件行)
# 重启 DSH 生效(启动日志出现 [dsh-pref-kit] llm/stream coalescer active)

更新:npm run build 后先 dsh plugin --profile web remove dsh-pref-kitadd。 卸载:dsh plugin --profile web remove dsh-pref-kit

配置

配置项默认说明
windowMs30 ms合并窗口(0–200ms);0 = 关闭合并(逐 token 透传)。窗口越大事件削减越多,首个字延迟 ≈ 窗口

实验项(Settings → Plugins → dsh-pref-kit 卡片 → 实验组):

配置项默认说明
experimental.replaceTrajectoryViewfalse替换轨迹视图;需同时把 ui-trajectory 加入下方行管理的禁用列表(或手工禁用该行)
experimental.chatContainmentfalse聊天区渲染提示(画面不变,浏览器少画视口外内容)
experimental.rowManager.enabled / disabledRowsfalse / []运行时禁用官方行(白名单:ui-trajectorysession-telemetry-oteltoken-metersession-statssession-projection-cachesession-query-sqlite);Host 即时生效并持久化,客户端需刷新页面

基准测试

离线可复现(固定种子 + 虚拟时钟,不连接 DSH;含逐块协议等价断言与复杂长会话生成器, 任何人可逐位复现):

场景事件数(基线 → 合并 30ms)首块延迟
短回复810 → 441(−45.6%)16 → 40ms
长回复9674 → 4501(−53.5%)20 → 28ms
复杂长会话(生成器)12210 → 10869(−11.0%)30 → 60ms
6 并发 agent35592 → 15788(−55.6%)18 → 50ms

运行:npm run benchmark。详细分析与实验性策略消融见[性能分析报告](docs/perf-bottlenecks.md)。

许可证

[MIT](LICENSE)