ADistanceThereIs/dsh-output-loop-guard ↗★ 0

dsh-output-loop-guard

DSH guard against self-repetition in streamed model output: detects a degeneration loop in reasoning or visible text, aborts the runaway turn and wakes the agent with a corrective notice. 适合经常遇到模型“复读机”或陷入思维链死循环的用户。

Package
dsh-output-loop-guard
Compatibility
Unverified
Harness peer range
*
Version
0.1.0
License
MIT
Last updated
Oct 16, 2026

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:ADistanceThereIs/dsh-output-loop-guard

Configuration

Override the row in the profile's cordis.patch.yml (a patch replaces the row's whole config, so restate every key you want to keep):

- id: output-loop-guard
  name: dsh-output-loop-guard
  config:
    dryRun: false                 # true = detect and log only, never cancel
    autoContinue: true            # wake the agent with the corrective notice
    maxTripsPerTurn: 2            # auto-continue budget per turn
    windowChars: 1200
    checkEveryChars: 64
    minPeriodRepeats: 6           # repeats required for a multi-line cycle
    singleLineMinRepeats: 40      # reasoning-channel single-line threshold
    singleLineTextMinRepeats: 60  # visible-text single-line threshold (0 = off)
    useDominantGram: true
    dominantGramCoverage: 0.55
    dominantGramMinCount: 24
    useFlatTic: true
    ticMinCount: 48
    ticMinCoverage: 0.25
    verbose: false

Start with dryRun: true if you want to observe detections in your own sessions before letting the guard abort anything.