dsh-dupguard
DeepSeek Harness 的实时重复内容防护插件。当流式输出中同一字符串重复 10 次以上时,立即停止模型生成。
AI 分析
核心用途是防止大模型在流式输出时陷入无限循环或复读机状态,从而节省 Token 消耗。适合经常遇到模型生成异常重复文本的用户。
安裝
此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗
說明文件
閱讀完整 README ↗配置 / Configuration
修改 plugin/host.js 或 lib/index.js 顶部 CONFIG 常量(两个入口需保持同步,CI 会校验一致性):
Edit the CONFIG block at the top of plugin/host.js / lib/index.js (both entries must stay in sync; CI verifies behavioral parity).
| 配置项 / Option | 默认 / Default | 说明 / Description |
|---|---|---|
threshold | 10 | 触发阈值:同一字符串连续重复 ≥ 该值时停止 / stop when the same string repeats ≥ this many times |
minUnitLength | 1 | 最小重复单元长度 / minimum repeating-unit length (1 also catches single-char loops like aaaaaaaaaa) |
maxUnitLength | 80 | 最大重复单元长度 / maximum repeating-unit length |
detectionWindow | 8192 | 检测滚动窗口(字符,去空白后)/ rolling detection window in chars (after whitespace removal) |
stripWhitespace | true | 检测前移除空白/换行,识别带分隔符的复读 / strip whitespace so "x x x" and "x\nx\nx" are caught |
monitorReasoning | false | 是否检测思考文本 / also guard reasoning (thinking) text — off by default, high false-positive risk |
monitorToolArguments | false | 是否检测工具调用参数 / also guard tool-call JSON args — off by default (base64/JSON repeats are common) |