Pull requests / #1854
#1854 Loop guard: catch a young sentence loop, splice medium effort on recovery
open · @Yunado · 0 comentários · No GitHub
Descrição
A production agent session this week looped inside its reasoning: one ~20-word sentence, 15 times in a row, carrying a stale premise from the previous turn. Two small additions to the #728 guard, both behind the existing opt-in `"reasoning_loop_recovery"` key. **Early detection.** The coverage look measures the last 2,000 words, so a young loop stays under the 25% line while it burns budget (this one measured ~15% at 15 repetitions, ~1,000 tokens spent before the guard could see it). A parallel trigger now fires when the same sentence runs 5 times in a row at the end of the reasoning. Pieces shorter than 8 words and 40 characters are out of the count, so repeated code, short lines and numbered enumerations stay safe; interleaved repetition remains the coverage look's job. **Medium effort recovery.** `focused_recovery_prompt` now matches the medium sentence as well as the xhigh one and splices it to low, so a medium-effort request gets the same rescue. The coding-agent report in #728 looped at effort medium, the shape this opens up. The xhigh splice is byte-identical; a test pins that. Checked: `tools/loop_guard_test.py`, 17 assertions (splice parity, medium, the None cases, the production shape, the length gate, CJK, interleaving, a coverage regression), plain python, no GPU or model needed. Not tested: a live looped session end to end.
No site
Links install, modelos, releases.