Repository navigation
Releases
Releases · ADistanceThereIs/dsh-output-loop-guard
v0.1.0 — output-loop-guard
First public release of dsh-output-loop-guard, a DSH guard against self-repetition in streamed model output.
What it does
- Watches live
agent/assistant-streamframes and detects output degeneration with four signals:repeated-block(shortest-period multi-line cycle),dominant-gram,repeated-line(channel-aware) andflat-tic(whitespace-free tics, reasoning channel only). - On detection:
agent.cancel({ kind: 'hook' })aborts the runaway generation, thenagent.steer(notice)wakes the agent into a fresh turn with an explicit correction, so the task continues instead of needing a human "continue". - After
maxTripsPerTurntrips the guard stops auto-continuing and only injects the notice.
Evidence
- Calibrated on 27 real sessions / 1,783 assistant steps: 24 detections, 0 false positives.
- The motivating 112,109-character runaway was caught after 2,944 characters (2.6%).
- 21 self-contained regression checks (
npm test). - Verified end-to-end in a live DSH runtime (
turn/endcarries thehookcancel reason, the message isinterrupted: true, and the corrective notice is injected).
Install
dsh plugin --profile <profile> add github:ADistanceThereIs/dsh-output-loop-guard
Requires DeepSeek Harness >= 0.2.0-rc.2. Restart DSH after installing.