Lyoko-Jeremie/dsh-compaction-threshold ↗★ 0
dsh-compaction-threshold
Override the automatic context-compaction pressure threshold of dsh-compaction-basic at runtime, without restating agent preset declarations. 适合需要精细控制上下文压缩时机、优化Token消耗的高级用户。
Other repositories with this package name
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Lyoko-Jeremie/dsh-compaction-thresholdREADME
Read the full README ↗配置
bundle 默认 thresholdRatio: 0.5。在 profile 的 cordis.patch.yml 覆盖(按行 id 替换整个 config):
- id: compaction-threshold
config:
thresholdRatio: 0.6
合法范围是 (0, 1],且必须大于引擎的 retainRatio(默认 0.16),否则自动压缩会在运行时拒绝该配置。
实际触发阈值并不等于 contextWindow × thresholdRatio,而是:
thresholdTokens = min(contextWindow × thresholdRatio,
contextWindow − maxTokens − headroomTokens)
例如:contextWindow = 1,048,576、maxTokens = 256,000、headroomTokens = 65,536 时,0.8 与 0.5 的实际阈值分别为 727,040 与 524,288。