mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3234] [CLOSED] [Engine] loop guard: recover on the sampling raise when no effort sentence is there to splice #4515
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#4515
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/3234
Author: @Yunado
Created: 10/19/2026
Status: ❌ Closed
Base:
main← Head:loop-guard-low-recovery📝 Commits (1)
6714badserve: recover a repeated reasoning on the sampling raise when no effort sentence matches📊 Changes
2 files changed (+15 additions, -7 deletions)
View changed files
📝
docs/DETAILS.md(+5 -2)📝
serve/server.py(+10 -5)📄 Description
The problem and the result.
"reasoning_loop_recovery": "recover"detects a repeated reasoning and then does nothing when the prompt carries no effort sentence to swap: a low-effort request, or a client that sends no effort sentence at all, leavesfocused_recovery_promptreturning None and the caller (if recover_prompt is not None: break) silently keeps generating. A production loop at low burned 29,476 output tokens withreasoning_recoveries=0while the detector itself reported coverage 1.0. With this change such a run recovers on the sampling raise the resume block already performs (temperature to at least 1.0, presence penalty to at least 1.5): it resumes from the same ids with no splice.The approach.
serve/server.py, three hunks in the guarded block: asplicedinit next tolooped; whenfocused_recovery_promptreturns None,recover_promptbecomesids + generated,splicedgoes False, and the loop breaks the same way a splice does; the recovery line in the server window says "on the sampling raise alone" instead of the low-effort-instruction wording.docs/DETAILS.md: the recover bullet says the splice needs the exact xhigh sentence, and without it the resume is the sampling raise alone. The xhigh splice,"stop"and the default path (both keys off) are byte-identical; requests with images never took the recovery and still do not.Validation.
py_compileon serve/server.py; two assertions on a fake tokenizer (one id per character, one special token):focused_recovery_promptreturns None for a low-effort render (the trigger of the new branch), and the xhigh splice is unchanged (low in, xhigh out).Limits. At low there is no sentence left to splice down to, so the sampling raise is the only lever; if it does not break the loop the request finishes as "length" as it does today. The change is behind the existing opt-in key and cannot fire when it is off.
Environment:
e88ee39d(v0.2.0-beta-12), Windows 11 Pro, Python 3.12.0, RTX 5090.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.