Repository navigation
fix: conclusive compress failure receipt when conversation is below minCompressRange - #1128
Conversation
…inCompressRange When the WHOLE visible conversation holds fewer chars than compress.minCompressRange, no range combination can succeed (the kernel sums range chars against the single threshold), yet the standard failure receipt gave only generic 'combine more messages' advice — steering models straight back into compress retries and acp_status/search_context inspection loops (root-cause factor 3 of #1112). Append one conclusive sentence to the applyRanges failure receipt when minCompressRange > 0 and total visible chars < minCompressRange: the floor is unreachable for any range, so do not retry compress or inspect ACP state about it. Kernel reason string and the #847 reversal note stay intact; when a viable larger range exists the generic advice is unchanged. No config schema change, no wire-shape change beyond failure-time tool-result text, plugin mode unaffected (receipt text only). Piece 1 of the owner-approved split of PR #1121 (surface-gating half stays out of scope); re-applied standalone on current master per the split directive. Closes #1124
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-1128Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr1128.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Reviewed PR #1128 end-to-end (pulled Diff audit (clean)
Local pre-flight on PR head (re-run by me, not just taken from the PR body)
CI (all on the PR branch)
Full e2e couldn't be re-run from this sandbox (local sglang upstream unreachable here), but the CI fake-codex e2e lane covers it and is green. One non-blocking observation (noting, not changing — the hunk is applied verbatim per the owner-approved split): Scope/invariants check: no config schema change, no wire-shape change beyond failure-time tool-result text, plugin mode unaffected (receipt text only), no load-bearing infra touched. Passes the §7.4 auto-merge gate criteria — but merge stays human per policy. 中文摘要:修复了会话整体低于 minCompressRange 时压缩失败回执仍给"合并更多消息"建议、把模型带进 compress/acp_status 重试循环的问题(#1112 根因因子 3),在失败回执决策点追加确定性结论句;已核对 diff 干净、本地 typecheck/test(2201 过)/build 全绿、CI 四条流水线全绿,可以合并。 |
What
Piece 1 of the owner-approved split of PR #1121 (whose surface-gating half was rejected as symptom-treatment and stays out of scope here), re-applied standalone on current master per the split directive.
In
src/stream.tsapplyRangesfailure path: whenminCompressRange > 0 && totalChars < minCompressRange(totalChars = sum of visible message text lengths), append one sentence to the existing failure receipt:The kernel reason string and the #847 reversal note stay intact; the sentence is appended after them. When a larger viable range exists (totalChars ≥ floor), the generic advice is unchanged.
Why
When the WHOLE conversation is under the floor, no range combination can succeed — the kernel sums chars across requested ranges against the single threshold. The generic "combine more messages…" advice at that moment pushes the model straight back into compress retries and acp_status/search_context inspection loops (#1112: a fresh Codex session burned follow-up turns exactly this way). This is root-cause factor 3 of #1112 (failure → re-request loop): the receipt itself was steering the model onto the ACP tool loop. Fixing it at the decision point (the receipt) rather than masking the symptom elsewhere.
Scope / invariants
r.errorswithblocksCreated: 0(kernel returns, does not throw), so only theblocksCreated === 0path is touched — same as the original fix: withhold ACP compression surface below minCompressRange (#1112) #1121 hunk, applied verbatim.src/stream.tshunk + receipt tests); this PR carries only that piece.Tests
New
tests/fix-1124-compress-receipt.test.ts(3 regression tests, adapted from the #1121 receipt tests to current-master harness conventions):minCompressRange: 0→ legacy behavior, tiny compress succeeds, no verdict.Pre-flight on rebased head (master @ aeeed25, branch base):
npm run typecheck— cleannpm test— 2203 tests: 2201 pass, 0 fail, 2 skipped (pre-existing env-gated skips)npm run build— successE2E note: full e2e suite not run from this sandbox (its upstream is infra-local); the change is failure-time tool-result text only, covered by the regression tests above.
Closes #1124