Repository navigation
[PR] fix: self-heal idle streak now resets on any-round compression evidence (#4578) - #6194
ranxianglei wants to merge 3 commits into
Conversation
…4578) The hook runs on every main request round (the kernel emits a NudgeDecision whether it injects or not), but the idleStreak reset was gated on nudgeActive. A fold lands BETWEEN injections and its new block is first observed by an ordinary non-nudge round, which consumed the reduction key without resetting — so the next injected round saw reduction=false and kept climbing. On plugin-route hosts (code-execution lanes where bili tool calls never echo in history, biliToolUses forever 0) exactly the 5th INJECTED nudge armed 'nudge idle for 5 rounds' suppression even though compressions had landed in every window in between. Evidence (reduction fingerprint change or visible bili tool use) now resets idleStreak whenever it is seen on ANY round; only nudge-carrying rounds earn idle credit. Zombie-streak semantics are byte-identical (still nudge-gated).
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9134-pr.6194.0ddcedbThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6194.tgz
npm install -g packageInstall instructions are refreshed on each push. |
The original suite's end-state asserts pass under BOTH old and new code: under the old gate the 5th injected round arms suppress-nudge and the following evidence round lifts it inside the same loop iteration, so nudgeSuppressed() reads false at every assert point. Verified by running the suite against master's session-self-heal.ts (4/4 pass pre-fix). Add a log spy asserting the 'nudge idle' arming line never appears across five obeyed cycles — the exact field symptom from #4578. The strengthened suite now fails 2/4 on master and passes 4/4 on the fix.
…he self-heal hook The hook runs on EVERY main round (the kernel emits a NudgeDecision whether it injects or not) — that fact is the premise of the #4578 fix itself, but both the evaluateSelfHealRound doc comment and the handle.ts call-site comment still said 'nudge-carrying rounds only' / 'the hook no-ops inside'. Comment-only clarification; no code change.
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 — 检索了 open+closed issue/PR:本 PR(#6194)是唯一针对 #4578 的修复;其余 open PR(#5092/#5935/#4691/#4773 等)均不触碰 Review verdict: mergeable (CI on the updated head still running)I independently re-derived the mechanism instead of trusting the PR text, and it holds up:
One real defect found and fixed in-place (pushed to this PR branch)The new test file did not actually pin the regression. All 4 tests pass identically against master's pre-fix code — I verified by running the suite against Fixed with two additive commits on
Local gates on the pushed head: targeted suites 17/17 green, Labels (judged on this PR's own diff, previously unlabeled): CI (live-checked just now): prior head 八问(结构化审核结论)
判定:可合入——待更新 head( |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Closing status update (the full structured review with the 八问 is the comment above — not duplicating it here): CI verdict is now final. Live-checked GitHub check-runs for the updated head So the single condition from my review verdict is met: ready to merge — owner merges (agents don't). Recap of what this session delivered on the PR:
Nothing further outstanding on this thread. |
(ai: vllm-qwen/qwen3.8-27b)
Closes #4578
What & why
The self-heal hook (
evaluateSelfHealRound) runs on every main request round — the kernel emits aNudgeDecisionwhether it injects or not, and onlyinjected/gatedrounds carrynudgeActive=true. But the idle-streak reset/increment was gated entirely insideif (inputs.nudgeActive).A fold lands BETWEEN injections: its new block is first observed by an ordinary non-nudge round, which consumed the reduction fingerprint key WITHOUT resetting
idleStreak. The next injected round then sawreduction=falseand kept climbing. On plugin-route hosts whose lanes never echo bili tool calls in history (code-execution lanes;biliToolUsesforever 0), exactly the 5th injected nudge armednudge idle for 5 roundssuppression even though compressions had landed in every window in between — matching the field log in #4578 (each false arming on exactly the 5th injection since last lift, every window containingtool compress executed via plugin … outcome=applied).Fix
Evidence (reduction-fingerprint change OR visible bili tool use) now resets
idleStreakwhenever it is seen on any round; only nudge-carrying rounds earn idle credit. Zombie-streak (D2 lane-degrade) semantics are byte-identical to before — still nudge-gated, so a dead-lane session surviving on preflight refolds still degrades.Behavior change (disclosed)
idleStreakreset condition: old = evidence observed during a nudge round only → new = evidence observed on any round. This is the intended fix; the observable difference is exactly the elimination of the false armings. Suppression of genuinely ignored nudges is unchanged (still arms after 5 nudge-carrying rounds without evidence).Tests (both directions, #3617 discipline)
New
tests/issue4578-self-heal-idle-reset.test.ts, pure state-machine:Existing
tests/issue2155-self-heal.test.ts(13 tests incl. D2 degrade/recovery integration) passes unchanged.