Skip to content

Releases

v0.1.0 — output-loop-guard

Choose a tag to compare

@ADistanceThereIs ADistanceThereIs released this 16 Oct 22:38

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-stream frames and detects output degeneration with four signals: repeated-block (shortest-period multi-line cycle), dominant-gram, repeated-line (channel-aware) and flat-tic (whitespace-free tics, reasoning channel only).
  • On detection: agent.cancel({ kind: 'hook' }) aborts the runaway generation, then agent.steer(notice) wakes the agent into a fresh turn with an explicit correction, so the task continues instead of needing a human "continue".
  • After maxTripsPerTurn trips 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/end carries the hook cancel reason, the message is interrupted: 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.