rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:xlcg10086/dsh-compact-threshold
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
在 DeepSeek Harness(DSH)的输入框旁实时调节上下文自动压缩阈值(20%–80%)。不重启 DSH,不改 profile 配置;把阈值调到当前用量以下时,空闲状态下会立即触发一次压缩。

compactNow(与 /compact 相同的底层路径)。tokenMeter(chars / 4 启发式,增量计算,零网络请求、零 token)。在 设置 → 插件 → 安装本地包 / 从压缩包安装 中选择 GitHub Release 的 .tgz,或在插件管理器里安装本仓库:
plugin_manager install_bundle target=<本仓库目录或 release tarball>
安装后在 插件 页启用 dsh-compact-threshold,无需重启(新 bundle 通过 HMR 生效)。
# 从 GitHub Release 的预构建 tarball 安装
dsh plugin --profile <profile> add \
https://github.com/xlcg10086/dsh-compact-threshold/releases/download/v1.0.0/dsh-compact-threshold-1.0.0.tgz
也可以直接从 GitHub 安装源码(需要本地构建环境):
dsh plugin --profile <profile> add github:xlcg10086/dsh-compact-threshold
面板中的「触发线」是插件实际会使用的阈值:它取 min(窗口 × 比例, 窗口 - 输出预留 - headroom),因此输出预留较大的模型(例如 500K 窗口、184K 输出预留)会显示低于滑条比例的实际触发百分比。
DSH 的 BasicCompactionEngine 在构造时会把 compaction-basic 配置解析成冻结对象,之后每个 step 读取 this.config 做压力判断。本插件不修改任何 profile 配置,而是:
agentPresets.serviceFor(agent, 'compaction') 取得该 Agent 所在 preset 隔离域中的真实压缩引擎实例;agent/created、agent/pre-step 和 agent/status 事件中,把当前滑条比例写入引擎实例的 config.thresholdRatio;compactIfNeeded() 因此使用新阈值——这是不需要重启 DSH 的关键;compactNow() 或下一个 step 的 compactIfNeeded()。阈值持久化在 $DSH_HOME/compact-control.json,重启 DSH 后保留。
compaction-basic 的 thresholdRatio 默认与上限均为 0.8;超过 80% 会拖累模型性能,也会与内置配置冲突。retainRatio 为 0.16,阈值必须明显大于保留比例,否则会出现「刚压缩完立刻又触发」的抖动。20% 留出了足够的安全边界。>= 0.2.1-rc.2dsh.client.platform: "web")插件不包含任何网络请求、遥测或外部服务调用。它只读写:
tokenMeter 测量值;$DSH_HOME/compact-control.json 中的阈值。# 语法检查
node --check index.js
node --check client.js
# 本地安装(DSH Desktop 插件管理器)
plugin_manager install_bundle target=<本仓库绝对路径>
插件结构:
index.js — Host:阈值状态、HTTP 路由、压缩引擎注入、立即压缩client.js — Client:conversation.input.left 槽位中的胶囊与面板cordis.patch.yml — bundle 补丁locale/*.json — DSH 插件列表显示元数据icon.svg、assets/icon-256.png — 插件图标Live auto-compaction threshold control (20%–80%) for the DeepSeek Harness composer. Adjust the threshold without restarting DSH; lowering it below current usage triggers compaction immediately when the agent is idle. See the Chinese sections above for the full design notes, or install the release tarball:
dsh plugin --profile <profile> add \
https://github.com/xlcg10086/dsh-compact-threshold/releases/download/v1.0.0/dsh-compact-threshold-1.0.0.tgz
MIT © 2026 xlcg10086
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。