Repository navigation
fix: recommend only viable compressible ranges (>=200 tokens) on all surfaces - #148
Merged
Merged
Conversation
ranxianglei
force-pushed
the
2026-08-15_viable-ranges
branch
from
August 15, 2026 01:24
bf269c8 to
e03a25d
Compare
ranxianglei
pushed a commit
that referenced
this pull request
Aug 15, 2026
This was referenced Aug 15, 2026
Merged
ranxianglei
pushed a commit
that referenced
this pull request
Aug 16, 2026
…ressRange since #148 viable-ranges The '2w limit fires the nudge' assertion (from #145) broke when #148 landed viable-ranges: the kernel now only counts merged ranges with tokens*4 >= minCompressRange (5000 chars) as effective T1 content. The 12x2000-char fixture's ranges all stayed under the gate, so the EMERGENCY nudge was correctly suppressed. Enlarge bulk text to 3000 chars/msg so the merged range clears the gate; the 100w-limit idle assertion is unaffected (2% usage, no pressure). Kernel behavior is intentional — fixture was stale.
HangxiangMa
pushed a commit
to HangxiangMa/billion-context-pi
that referenced
this pull request
Sep 21, 2026
…-ranges fix: recommend only viable compressible ranges (>=200 tokens) on all surfaces
HangxiangMa
pushed a commit
to HangxiangMa/billion-context-pi
that referenced
this pull request
Sep 21, 2026
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.
Backport of billion-context-omp PR #7 (same kernel, same failure mode observed in the wild there).
Problem
The kernel's nudge can recommend fragmented ranges as compressible — e.g. a 16-token one-message ack. A model that follows the recommendation list and batches all ranges into one compress call gets atomically rejected: the kernel validates the whole batch, and a tiny range cannot carry a meaningful >=50-char summary ("Summary too short (43 chars, min 50)"). Observed on the omp sibling: a 14-range recommendation containing a 16-token range — every batch attempt failed until the model improvised around the list.
Change
messages.ts:VIABLE_RANGE_MIN_TOKENS = 200+viableRanges()index.ts: the injected nudge'scompressibleRangesis filtered before rendering (renderNudgeText and the example line see the same list)status-tool.ts: acp_status uncompressed viewcommands.ts: the /acp panelPurely advisory filtering: compress itself is untouched — the model can still compress any range it can argue for; kernel guards (min range, min summary) unchanged.
Test
tests/viable-ranges.test.ts— unit filter behavior + a pipeline test asserting the filtered list can't leak sub-200 ranges. Red-green verified (revert src → export missing → red). Suite: 155 pass / 17 fail — the 17 pre-exist on master (env-dependent), unaffected by this change.