baldovinmarques391-design/dsh-compact ↗★ 0

dsh-compact

Ratio-exact compaction trigger for DeepSeek Harness: gate automatic context compaction at a fraction of the routed model's window, with no fixed headroom deduction. 适合需要精准控制 Token 消耗、防止超出模型窗口上限的 DSH 用户。

パッケージ
dsh-compact
互換性
未検証
バージョン
0.1.1
最終更新
2026/10/17

同名パッケージの別リポジトリ

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:baldovinmarques391-design/dsh-compact

ドキュメント

README 全文を読む ↗

配置

全部走 profile 的 cordis.patch.yml(本插件是纯 host 插件,没有 GUI 设置面板):

- id: dsh-compact
  config:
    enabled: true
    routes: '*'
    triggerRatio: 0.9
    minOutputReserve: 0
    dryRun: false
    monitorPath: '/dsh-compact-monitor.jsonl'
字段默认含义
enabledtrue总开关
routes'*'生效路由:provider 或 provider/model,逗号/空格分隔
triggerRatio0.9窗口用到此比例时压缩,范围 [0.05, 0.98]
minOutputReserve0输出保护底线(token):剩余空间低于它则提前压缩;0 = 关闭
dryRunfalsetrue = 只记录判定、绝不压缩
monitorPath系统临时目录判定监视器(JSONL)。空则不写

monitorPath 是必要的

被抑制的检查既不调用引擎、也不写会话事件,所以在会话日志里完全不可见。 监视器是唯一的观测通道,每行一条判定:

{"decision":"skip","contextWindow":1000000,"reservedCompletionTokens":256000,
 "thresholdTokens":900000,"nativeThresholdTokens":678464,
 "measuredTokens":14113,"surfaceTokens":11864,"pendingTokens":2249}
  • thresholdTokens = 本插件阈值;nativeThresholdTokens = DSH 原生阈值
  • decision:"skip" 且 measuredTokens ≥ nativeThresholdTokens 即:插件拦下了一次原生本会执行的压缩