zqh260619/dsh-dupguard0

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 大模型流式输出中的重复内容,同一字符串重复十次以上立即停止生成。

包名
dsh-dupguard
版本
1.0.0
许可证
MIT
最近更新
2026年8月16日

安装

此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗

配置 / Configuration

修改 plugin/host.jslib/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
threshold10触发阈值:同一字符串连续重复 ≥ 该值时停止 / stop when the same string repeats ≥ this many times
minUnitLength1最小重复单元长度 / minimum repeating-unit length (1 also catches single-char loops like aaaaaaaaaa)
maxUnitLength80最大重复单元长度 / maximum repeating-unit length
detectionWindow8192检测滚动窗口(字符,去空白后)/ rolling detection window in chars (after whitespace removal)
stripWhitespacetrue检测前移除空白/换行,识别带分隔符的复读 / strip whitespace so "x x x" and "x\nx\nx" are caught
monitorReasoningfalse是否检测思考文本 / also guard reasoning (thinking) text — off by default, high false-positive risk
monitorToolArgumentsfalse是否检测工具调用参数 / also guard tool-call JSON args — off by default (base64/JSON repeats are common)