dsh-run-guard: Intercepts reasoning dead loops and prevents immediate stopping after reasoning, a DSH running rhythm guardian plugin

dsh-run-guard is a DSH runtime rhythm guard plugin targeting two types of anomalies when running long tasks with DeepSeek V4 Flash configured with `reasoningEffort: max`: stopping immediately after reasoning (has reasoning, no body, no tool calls) and reasoning infinite loops (spinning for several minutes, with single-step disk writes reaching 1.32 million characters). The plugin provides brakes and gas in an "everything is a plugin" philosophy: the `guard` monitors `llm/stream`, using sliding window repetition rate detection combined with hard limits for double insurance to interrupt infinite loops within 1-2 seconds and automatically retry (default 2 times per turn); `recovery` automatically retries for transient upstream failures like `PI_AI_ERROR`; and `continue` automatically continues running after a turn ends normally, handling continuous failures when there is a todo.

Read More