dsh-output-loop-guard: Intercepting model self-repetition degradation loop in streaming output

dsh-output-loop-guard is a DSH bundle plugin maintained by ADistanceThereIs. It monitors agent/assistant streams, utilizing a sliding window and four structural signals (repeated-block, dominant-gram, repeated-line, flat-tic) to detect degenerate loops in reasoning or visible text. Upon triggering, it aborts generation via agent.cancel and injects a corrective notification via agent.steer to wake the agent, addressing the blind spot of the repeat-tool-reminder which only detects repeated tool calls. It requires DSH >= 0.2.0-rc.2, supports dryRun, and has configurable thresholds; the README reports 24 detections with 0 false positives across a replay of 27 conversational corpora. Installation is available via GitHub commit, local tgz, or the v0.1.0 Release URL, and requires a restart of DSH to take effect.

Read More