Skip to content

fix(strata): catch short reasoning loops below 2,000 words - #237

Merged
shuk777 merged 1 commit into
Edge0-AI:mainfrom
sx4im:fix-236-reasoning-loop-short-turns
Nov 17, 2026
Merged

shuk777 merged 1 commit into
Edge0-AI:mainfrom
sx4im:fix-236-reasoning-loop-short-turns

Conversation

@sx4im

@sx4im sx4im commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

What & why

Fixes #236

The recovery detector never fired on the short "Hmm" turns: reasoning_repeat_coverage returned 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 (new LOOP_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

  • Other (edge0-strata/serve)

How was it tested?

python -m unittest serve.test_reasoning_loop_recovery in 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 in edge0-infer/ (engine changes)
  • Ran the higher test levels this change affects (see edge0-infer/docs/testing.md)
  • Added/updated tests for new behavior
  • Updated relevant docs / READMEs (incl. translations if user-facing)

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 shuk777 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks — LGTM. Merging.

@shuk777
shuk777 merged commit ff2acc3 into Edge0-AI:main Nov 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Engine] Edge0-145B reasoning fills with "Hmm, hmm"; reasoning_loop_recovery misses turns under 2,000 words

2 participants