Skip to content

Commit 6968c5e

Browse files
committed
feat(opencode): add repetition-loop detector
Degenerate flash-model streams (GLM 5.3, DeepSeek) repeat one char or one phrase forever: tokens keep flowing, so the silence-based stall watchdog resets forever and never fires, and the turn burns the output limit until manual abort (anomalyco/opencode#52763). Detect on the live text/reasoning delta tail instead of silence: single-char floods (>=512 non-ws chars, 95% dominant) and periodic phrase units (any 2-128 char sequence; repeat bar scales so ~256 chars of pure periodic tail trips, floor 12 for long units, cap 64 for two/three-char floods). Recovery is orchestration-aware: a session that is a subagent, or a manager with agents in flight, is never interrupted - a hard stop cascades cancellation into the manager's agents. Those get a stop-sequence command message delivered directly to the degenerate agents instead. Leaf sessions get abort+resume with a fresh prompt. Refs anomalyco/opencode#52763
1 parent 45342c6 commit 6968c5e

1 file changed

Lines changed: 335 additions & 7 deletions

File tree

  • common/.config/opencode/plugins/opencode-auto-resume-v2

0 commit comments

Comments
 (0)