Repository navigation
fix(strata): catch short reasoning loops below 2,000 words - #237
Merged
Merged
Conversation
reasoning_repeat_coverage returned 0.0 until the reasoning held 2,000 words, so the recovery detector never fired on the 71 ' Hmm' turns of 512-2,559 tokens in Edge0-AI#236. Judge the window once it holds 300 words instead: below that, one repeated passage weighs too much against the 0.25 bar to call it a loop.
shuk777
approved these changes
Nov 17, 2026
shuk777
left a comment
Collaborator
There was a problem hiding this comment.
Thanks — LGTM. Merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Fixes #236
The recovery detector never fired on the short "Hmm" turns:
reasoning_repeat_coveragereturned 0.0 until the reasoning held 2,000 words, so the 71 turns of 512-2,559 tokens in the report were all missed. The window is now the whole reasoning once it holds 300 words (newLOOP_MIN_WORDS), so a few hundred words of one repeated filler is caught at the first check. Below 300 words it still returns 0.0, since one repeated passage weighs too much against the 0.25 bar there to call it a loop. Long-turn behavior is unchanged.Area
How was it tested?
python -m unittest serve.test_reasoning_loop_recoveryin edge0-strata: 21/21 pass. New tests: a 350-word "Hmm" turn now reads coverage >= 0.25 (was 0.0), a 250-word one still reads 0.0, ordinary short reasoning still reads 0.0, and in "stop" mode the same filler as generated output ends at 1,024 tokens (was 5,632). No GPU here, so the live model session from the report is not verified; that stays for the maintainers.Checklist
ctest --preset cpu -L "L0|L1"passes locally inedge0-infer/(engine changes)edge0-infer/docs/testing.md)