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 Analysis
核心用途是防止大模型在流式输出时陷入无限循环或复读机状态,从而节省 Token 消耗。适合经常遇到模型生成异常重复文本的用户。
Install
This plugin has no verified bundle, or compatibility checks failed. Read the repository notes first. Read the full README ↗
README
Read the full 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) |