mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #2906] [Bug]: reasoning_loop_recovery: recover never fires for a low or medium request (focused_recovery_prompt only matches the template's xhigh sentence) #1176
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#1176
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?
Originally created by @BoogeAI on GitHub (Oct 17, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2906
What happened
With
"reasoning_loop_recovery": "recover"in a model config, a reply whose thinking repeats whole passages is detected and then does nothing: the server logs the detection and the thinking carries on toreasoning_budget_tokens(or tomax_tokenswhen no budget is set). The reply is not continued with the low-effort instruction, and nothing says why.Measured on 0.1.44.1 and again on 0.1.45, a community qwen4exp fine-tune (RVN abliterated IQ3_S),
reasoning_effort: low, one prompt that makes the model re-verify the same facts,max_tokens8192,reasoning_budget_tokens8192 then 4096:repeated reasoning detected at 3072 tokens (coverage=0.277)repeated reasoning detected at 3072 tokens (coverage=0.289)repeated reasoning detected at 3072 tokens (coverage=0.343)So the detector works (it is the log line above); the recovery step is what never runs.
Why
focused_recovery_prompt()(serve/server.py:196in 0.1.45) builds the spliced prompt by replacing the template's own xhigh sentence (HIGH_EFFORT, line 160) in the first system message with the low one, and returnsNonewhen that sentence is not there as whole tokens:With
"effort_position": "start"(the default) a request that asks for low or medium is rendered with that level's sentence at the top of the first system message, so the xhigh sentence is absent and the function returnsNone. The caller only acts on a non-None result:recoveris therefore a silent no-op for every low/medium request — which is the common case as soon as a config sets"reasoning_effort": "low"(as mine does, to keep a local model from burning its output budget on thinking) or a client picks Low in its own selector."reasoning_loop_recovery": "stop"is unaffected (it does not use this function and did end the reply in my runs).How I checked it (no engine needed)
Rendering one request both ways with the server's own functions and then calling
focused_recovery_prompton it:Script: build the tokenizer and the
ChatTemplatefrom a pack'stokenizer/exactly asmain()does, thenWorkaround I use now
"effort_position": "end"in the model config: the history is then rendered with the template's default (xhigh) and the real level follows in a short system turn before the answer, so the xhigh sentence is in the prompt and the recovery can splice it. With it, the detection line is followed byresuming the same output with the low-effort instruction (reasoning_loop_recovery)(measured twice, coverage 0.277 and 0.343).Two honest notes on that: the nudge is not a cure — in both runs the model went on thinking for another ~1000-3000 tokens to the budget — and
effort_position: "end"is a separate opt-in with its own behaviour (the engine checkpoints in front of the tail turn).Suggested fix
Pass the request's level into
focused_recovery_prompt()and look for that sentence (the template knowslow,medium,xhigh;highmaps to xhigh), or fall back to the low sentence when the level's own is not found. If neither is found, print one line saying the recovery was skipped and why, instead of failing silently — the current behaviour costs a full thinking budget with no hint.Environment
0.1.44.1 and 0.1.45, prebuilt CUDA 13.0 engine (sm_75/86/89/120) · RTX 5080 16 GB · Windows 11 26200 · Core Ultra 7 270K Plus, 95 GB RAM. Config:
reasoning_effort: low,reasoning_budget_tokens: 4096/8192,reasoning_loop_recovery: recover,reasoning_close_retry: true.Not tested
AMD HIP and SYCL (CUDA only here); a high/xhigh request under
effort_position: "start"(that one renders the xhigh sentence at the top, so the recovery should fire — I did not run it); the Anthropic route'soutput_config.effortpath; and whether the model's repetition after the nudge would end on its own with a different prompt.@Niko1221 commented on GitHub (Oct 19, 2026):
Thanks for taking the time to report this.
We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.