dsh-compact
DeepSeek Harness 上下文自动压缩、手动压缩与溢出恢复插件
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:zixin947/dsh-compact说明文档
阅读完整 README ↗默认配置
| 配置项 | 默认值 | 说明 |
|---|---|---|
enabled | true | 是否启用自动压缩和溢出恢复 |
thresholdRatio | 0.75 | 上下文达到模型窗口的 75% 时触发自动压缩 |
retainRatio | 0.20 | 压缩后保留最近约 20% 的上下文 |
recoverOnOverflow | true | 上下文溢出时是否尝试压缩恢复 |
maxOverflowRetries | 1 | 原请求发生溢出后允许的最大恢复重试次数 |
modelPolicies | [] | 按 provider 和 model 精确覆盖默认策略 |
示例:
- id: compact
name: 'dsh-compact'
config:
enabled: true
thresholdRatio: 0.75
retainRatio: 0.20
recoverOnOverflow: true
maxOverflowRetries: 1
modelPolicies:
- provider: youchu
model: deepseek-v4-flash
thresholdRatio: 0.80
retainRatio: 0.20
约束:
thresholdRatio允许范围为0.50到0.95。retainRatio允许范围为0.05到0.50。retainRatio必须小于对应的thresholdRatio。- 模型策略使用
provider + model精确匹配。