mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1854] [CLOSED] Loop guard: catch a young sentence loop, splice medium effort on recovery #3722
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3722
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1854
Author: @Yunado
Created: 10/10/2026
Status: ❌ Closed
Base:
main← Head:loop-guard-early-detection-and-medium-splice📝 Commits (1)
7c9b3a7loop guard: catch a young sentence loop and splice medium effort on recovery📊 Changes
3 files changed (+167 additions, -19 deletions)
View changed files
📝
docs/DETAILS.md(+9 -6)📝
serve/server.py(+49 -13)➕
tools/loop_guard_test.py(+109 -0)📄 Description
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_promptnow 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.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.