Repository navigation
fix: break chicken-and-egg deadlock in batch cleanup nudge system - #27
Merged
ranxianglei merged 1 commit intoJun 28, 2026
Merged
Conversation
buildNudgeText() returned undefined when no blocks were marked, creating a deadlock: model doesn't mark → nudge doesn't fire → model doesn't know to mark → repeat. The nudge that's supposed to encourage marking required an existing mark to fire. Three-tier escalation design: - No marks + old-gen blocks: guide model to start marking (📋) - Some marks (<3 or <40% ratio): encourage marking more (⚠️ ) - Enough marks (≥3 AND ≥40% old-gen ratio): urge active compress (🔥) Additional fixes: - High-tier (75%) now falls through to nudge instead of returning noop when merge conditions unmet — model gets guidance at high pressure - lowThreshold lowered from 60% to 55% (aligns with compress trigger) - Escalation ratio computed against old-gen subset (not all marked blocks) - collectActiveMarkedBlocks self-cleans stale marks for deactivated blocks Oracle review: APPROVE_WITH_NITS (both nits addressed) Tests: 22/22 pass, tsc --noEmit clean
ranxianglei
pushed a commit
that referenced
this pull request
Aug 28, 2026
…minContextLimit Per @Dog's feedback in issue #342: minContextLimit defaults to 80% (lib/config.ts:200) and is documented as the soft lower threshold for turn/iteration reminders, so gating growth nudges on it suppresses ALL growth nudges below 80% for default users — effectively disabling compression for most of a session. The dual-agent review's minLimitResolved guard did not address this (a default user with a known context still gets growth nudges suppressed below 80%). Use minNudgeContextPercent (default 15, a percent of model context) as the growth-nudge floor instead. It is the intended 'don't nudge below this' knob and was previously a no-op (plumbed into computeShouldNudge but ignored). When the model context limit is unknown the floor is unresolvable and growth nudges keep pre-#342 behavior. overMaxLimit and the emergency override bypass the floor; T2/T3 tier-promotion nudges are unaffected. - Reverts the review commit's minLimitResolved mechanism (dead code here) - Preserves the review commit's README/CONFIGURATION default fixes (80%/80%) - Tests: 4 floor tests + 2 new (unresolvable model limit, T2 independence) re-pointed at the floor; pre-existing test #27 raised into the [floor, max) range. 1035 tests, 0 failures.
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.
buildNudgeText() returned undefined when no blocks were marked, creating a deadlock: model doesn't mark → nudge doesn't fire → model doesn't know to mark → repeat. The nudge that's supposed to encourage marking required an existing mark to fire.
Three-tier escalation design:
Additional fixes:
Oracle review: APPROVE_WITH_NITS (both nits addressed)
Tests: 22/22 pass, tsc --noEmit clean