citydirector/dsh-loop-rescue ↗★ 0
dsh-loop-rescue
自动检测并截断模型重复生成的死循环 适合经常遇到模型推理或文本无限重复输出,需要自动剪枝并恢复会话的用户。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:citydirector/dsh-loop-rescue说明文档
阅读完整 README ↗Configuration
The defaults work as they are. To change them, write to the profile's cordis.patch.yml:
- set:
- id: loop-rescue
config:
mode: rescue # rescue: cut + prune + resume | cut: cut + prune | observe: log only
watch: both # both | reasoning | text
marker: true # leave a "〔N chars of repeated reasoning removed〕" line where it pruned
maxConsecutiveRescues: 3 # cap on back-to-back rescues; one normal call resets it
stallCalls: 3 # nudge after this many reasoning-only calls with no output; 0 = off
stallMinReasoningChars: 1024
retryTemperature: 1.0 # temperature for the resume request; unset = unchanged
retryReasoningEffort: low # reasoning effort for the resume request; unset = unchanged
retryRequests: 1 # how many requests after a resume use the two settings above
language: auto # auto | zh | en
detector: # detection thresholds; rarely need changing
poolWindow: 30
poolMinCoverage: 0.75
cycleMinChars: 600
Consider running mode: observe for a day or two first, check that every loop-rescue: ... loop detected line in the log is a real loop, then switch to rescue.