dsh-dupguard
Real-time repetition guard for DeepSeek Harness (DSH): stops model generation when the same string repeats >=10 times in the streamed output. 实时检测 DSH 大模型流式输出中的重复内容,同一字符串重复十次以上立即停止生成。
AI 분석
核心用途是防止大模型在流式输出时陷入无限循环或复读机状态,从而节省 Token 消耗。适合经常遇到模型生成异常重复文本的用户。
설치
검증된 bundle이 없거나 호환성 검사에 실패했습니다. 먼저 저장소 설명을 읽어 주세요. 전체 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) |