Skip to content

[PR] fix: Disable the "Continue Compressing" recommendation in the compression receipt by default (compress.postComPressTail) | fix: 压缩回执的"继续压缩"推荐默认关闭(compress.postComPressTail),开启后未覆盖提示每轮最多一次 - #7415

Merged
ranxianglei merged 2 commits into
masterfrom
2026-11-20_post-compress-tail-default-off
Nov 21, 2026

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

⚠️ MODEL-FACING TEXT CHANGE — 本 PR 改变压缩成功回执里模型看到的内容:默认(compress.postComPressTail 关)时,回执不再在每次成功折叠后重新推荐剩余可折叠范围,也不再发 "Uncovered history remains" 审计提示;显式开启后恢复范围列表,且未覆盖提示每个 nudge 注入周期最多发一次(新注入重开)。上下文已耗尽时的逐字停止信号(#1387)两种模式都逐字保留;每轮增长 nudge(KDD #8)是独立通道,不受影响。

现象与根因

#7318(0.1.216 构建,一晚 200+ 次压缩折叠):模型每次 compress 成功后,回执尾部的 Current compressible ranges (use these refs exactly as listed): 列表把范围 ref 直接递给模型复制到下一次调用——这是模型持续折叠的传播锚点。用户已明确说停,回执却每轮重新推荐;未覆盖历史提示(每次 ≥10K token 未覆盖就发)叠加形成 compress→note→compress 循环(同族:#6522「不要连续推荐」、#5872 回执驱动单消息重试)。每次折叠改写上下文前缀并重新计费 prompt cache。

修法(按 owner 2026-11-20 定夺)

  1. 推荐整体默认关闭:新增 compress.postComPressTail(boolean,默认 off),off 时回执对"还能折什么"保持沉默——不列范围、不发未覆盖提示、也不发"已到底"假声明([Bug] compress reports 'no compressible ranges remain' while mid-history spans sit outside every block #4331 诚实性)。
  2. 开启后未覆盖提示最多一次([PR] fix(compress-receipt): fire the uncovered-history note at most once per session (#6522) #6526 语义):session.uncoveredReceiptNoted 内存闩,发一次后闩住;真实 nudge 注入(nudgeOutcome === "injected")重开闩——新 nudge 意味着上下文又涨到了该顺手压缩的时刻;重启复位,至多多发一条。
  3. 开关沿既有 nudge gate 管道每轮盖进 session.transient(src/unprompted-gate.ts,与 requireNudge/requireRecommendation 同缝);无盖戳 = off(防御性默认:未知姿态不推荐)。

消费链推演(#6855 纪律):被删文本里唯一的前向传播锚点就是范围列表的 ref(模型逐字复制进下一次 compress 调用),删除即锚点消失,不存在 phantom-value 类;停止信号逐字未动,依赖它的模型看到相同字节;回执其余部分字节不变。

config surface

  • 新增 compress.postComPressTail:boolean,默认 off,进入既有 mergeCompress 三级合并(model > provider > global)。
  • 为什么既有表达不了:现有 compress 层级没有"回执推荐"开关;requireNudge 管的是拦截越界折叠,方向相反;nudge 文案/节奏由 kernel 拥有(KDD feat: release CI (npm auto-publish on release branch) #8)不该为此改。
  • 非布尔值与 requireNudge/requireRecommendation 一致:整块拒绝。
  • 无新增环境变量(彻底整治环境变了滥用,除非必要都走配置文件 #2030):走既有 compress 文件层级。
  • 文档:website/config-reference/compress.yaml 种子条目 + gen-config-docs 重新生成 configuration.md en/zh/ja + website。

测试

关系

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-20_post-compress-tail-default-off (68d0df2)

Latest build — install this exact version

npm install -g billion-context@0.0.11115-pr.7415.9277f91

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
68d0df2 billion-context@0.0.11115-pr.7415.9277f91 build
d401a28 billion-context@0.0.11108-pr.7415.af3c442 build
59dadb1 billion-context@0.0.11107-pr.7415.b7d404e build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr7415.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title fix: 压缩回执的"继续压缩"推荐默认关闭(compress.postComPressTail),开启后未覆盖提示每轮最多一次 [PR] fix: Disable the "Continue Compressing" recommendation in the compression receipt by default (compress.postComPressTail) | fix: 压缩回执的"继续压缩"推荐默认关闭(compress.postComPressTail),开启后未覆盖提示每轮最多一次 Nov 20, 2026
…efault off)

⚠️ MODEL-FACING TEXT CHANGE — the success compress receipt changes what the
model reads: with the new default (compress.postComPressTail off, the
pre-existing behavior is NOT the default), the receipt no longer re-advises
the remaining foldable ranges after every successful fold, and no longer
emits the 'Uncovered history remains' audit note. With it on (explicit opt-in),
the range list is restored and the uncovered note fires at most once per
nudge-injection cycle (fresh injection re-opens it). The verbatim
context-minimum stop signal is unchanged in both modes.

Consumption-chain reasoning (#6855 discipline): the removed text carried the
only forward-pointing refs the model propagated into its NEXT compress call
(startId/endId copied from the 'Current compressible ranges' list). Removing
it removes the propagation anchor entirely — no phantom-value class possible.
Nothing else in the receipt is altered byte-wise; the stop-signal sentence
(#1387) is preserved verbatim, so models that key on it see identical text.
The per-turn growth nudge (KDD #8) is a separate channel and untouched.

Why: per-receipt re-recommendation drove models into endless fold loops
against explicit user stop requests (#7318: 200+ folds in one night on a
0.1.216 build; #6522 '不要连续推荐' and #5872 are the same family — the
receipt footer drives single-message retry folds). Each fold rewrites the
context prefix and re-bills the prompt cache.

config surface (#1437 discipline, owner decision in-thread 2026-11-20):
adds compress.postComPressTail (boolean, default off) to the existing three-
level compress hierarchy (global/provider/model via mergeCompress); boolean
only (non-boolean rejects the whole block like the sibling requireNudge /
requireRecommendation); no new env var (knob goes through the existing
compress file hierarchy, env-discipline #2030). Docs: config-reference seed
entry + regenerated configuration.md en/zh/ja + website.

Plumbing: the flag is stamped per round on session.transient next to the
existing nudge gate (src/unprompted-gate.ts) and read at the tail decision
point in src/stream.ts — off by default when a session has no stamp
(defensive: never recommend on an unknown posture). The #6522 at-most-once
latch rides on an in-memory Session field (uncoveredReceiptNoted), re-opened
only by an actual nudge injection.

Fixes #7318 (design: default off); implements #6526's at-most-once note (that
PR is superseded — its change was unconditional, this one is gated).
Supersedes: #6526
@ranxianglei
ranxianglei force-pushed the 2026-11-20_post-compress-tail-default-off branch from 59dadb1 to d401a28 Compare November 20, 2026 15:07
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷

查重:不重复(与 #6526 同机制,本 PR 是其超集)

初审发现一个 #4331 诚实性回归:postComPressTail 开启且未覆盖提示闩(latch)已置位、但仍有 ≥10K token 未覆盖空洞时,回执会 fall-through 到 "No compressible ranges remain"(已到底声明)——而原代码在此情形恒发未覆盖提示、从不发已到底声明。正在核对并修,稍后给完整八问结论。

CI 全绿(30 checks,0 failed;PR 落后 master 9 个提交,mergeable)。

…t minimum (#7318)

The #7318 anti-nag latch (session.uncoveredReceiptNoted) made a latched fold
fall through to the "No compressible ranges remain" stop signal even when a
>=10K-token run still sat outside every active block — a false "at its
minimum" claim that breaks the #4331 honesty contract (the pre-#7318 code
always returned the uncovered note in that case, never the minimum claim).
Return "" (honest silence) instead: the detail stays available on demand via
acp_status(scope:"uncompressed"). Update the N2 regression test to assert the
silence rather than the false claim.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷

PR #7415 审核结论(八问)

是什么问题:#7318——压缩成功回执尾部的"继续压缩"推荐(剩余可折范围列表 + "Uncovered history remains" 提示)把范围 ref 直接递给模型复制进下一次 compress,叠加成 compress→note→compress 循环(0.1.216 一晚 200+ 次折叠,用户已明确说停仍每轮重推)。

什么原因导致的:回执的范围列表是模型持续折叠的传播锚点——模型逐字复制 ref 进下一次调用;未覆盖提示(每次 ≥10K token 未覆盖就发)叠加形成循环。每次折叠改写上下文前缀并重新计费 prompt cache。根因是"回执每轮重新推荐",不是"模型不听话"。

影响范围与严重程度:所有用户(回执对所有会话展示)。严重度中高——循环驱动 200+ 次折叠/晚,浪费算力 + 重复计费;但非数据丢失/不可用,用户明确说停时模型仍可停止(主要是浪费 + 体验)。

怎么修复的:推荐整体默认关闭(新开关 compress.postComPressTail,默认 off)。off 时回执对"还能折什么"保持沉默——不列范围、不发未覆盖提示、不发"已到底"假声明(#4331 诚实性)。on 时恢复范围列表,未覆盖提示每个 nudge 注入周期最多一次(session.uncoveredReceiptNoted 内存闩,真实 nudge 注入 nudgeOutcome==="injected" 重开,重启复位)。开关沿既有 nudge gate 管道每轮盖进 session.transient,无盖戳 = off(防御性默认)。

是否有回归问题:审了回执全部分支。发现并修复一个 #4331 诚实性回归(已推 commit 68d0df2):latch 闩住后、仍有 ≥10K token 未覆盖空洞时,回执 fall-through 到 "No compressible ranges remain"(已到底声明)——而 pre-#7318 代码在此情形恒发未覆盖提示、从不发已到底声明。我用 60 轮会话构造复现(fold 1 闩住 → fold 2 折小段,空洞仍 17 轮 ≈34K tok)确认误发"已到底"。修法:latch 置位 + 未覆盖质量 ≥ floor → 返回 ""(诚实沉默),不 fall-through 到假声明;N2 回归测试已更新断言沉默。其余分支无回归:off 三态(部分折叠/耗尽+空洞/耗尽+排空)、on 范围列表(legacy 保留)、停止信号 #1387 逐字保留(两种模式)、nudge 通道(KDD #8)独立不受影响。

是否破坏缓存:不破坏,反而改善——默认 off 时回执更短(无范围列表),循环减少 → 前缀改写减少 → prompt cache 更稳。

是否改了设计方向:无架构变更。新增一个 config 开关 + 一个内存 latch。方向合理(推荐 opt-in,与 requireNudge/requireRecommendation 同缝)。

是否引入了新的配置:是,compress.postComPressTail(boolean,默认 off),进入既有 mergeCompress 三级合并(model > provider > global)。非布尔值整块拒绝(与 requireNudge/requireRecommendation 一致)。无新增环境变量(#2030)。文档 en/zh/ja + website(index.html + main.js i18n)已同步。


回归审查(既有行为清点):

测试有效性:新 tests/issue7318-post-compress-tail.test.ts 6 用例双方向断言(#3617),断言具体字符串(非恒真);N2 已更新为 latch+未覆盖质量→沉默的回归测试。7 个既有回执测试文件改显式 ON 盖戳(断言 legacy)。本地全绿(issue7318 6/6 + 7 个既有文件)。

diff 整洁度:原 PR 20 文件 348 增 10 删;我的修复 commit 68d0df2 2 文件 15 增 2 删(src/stream.ts + 测试)。无无关改动、无空行重排、无锁文件连带。

CI 状态:新 head 68d0df2 CI 运行中(25 success / 14 skipped / 8 in_progress / 6 queued,0 failed)。本地 typecheck 干净、定向套件全绿。

合并判定:方向合理、回归已修、测试有牙、diff 干净。默认行为变更(推荐默认 off)属产品决策,不能 auto-merge(§7.4:fallback/default-value change 必须 human)。等 CI 全绿 + owner 拍板后可合。#6526 可关(本 PR supersedes)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷

CI 更新:新 head 68d0df2(含 #4331 诚实性修复)CI 全绿——54 check_runs,39 success / 15 skipped / 0 failed,无 in_progress/queued。

合并判定不变:方向合理、回归已修、测试有牙、diff 干净、CI 绿。默认行为变更(推荐默认 off)属产品决策,不能 auto-merge(§7.4),等 owner 拍板后可合。#6526 可关。

@ranxianglei ranxianglei added bug Something isn't working p2 scope/wiring labels Nov 20, 2026
@ranxianglei
ranxianglei merged commit e691e6e into master Nov 21, 2026
96 of 138 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.1242-master.e691e6e (rolling master tag).

npm install -g billion-context@0.0.1242-master.e691e6e  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

Louie0806 added a commit to Louie0806/billion-context that referenced this pull request Nov 21, 2026
master e691e6e (PR ranxianglei#7415, 3 commits / 20 files) touches the compress
receipt "fold more" recommendation and the uncovered-note fold silence.
Six of its files overlap this lane (three configuration docs, the
compress seed, website/docs/index.html, website/main.js); all auto-merge
with no hand resolution.

Verified on the merged tree: kernel build ok, tsc only the five
pre-existing @deepseek-ai/cordis farm errors, five gates ok, config docs
idempotent (no diff), lane anchors intact (isDraftDump at
src/plugin.ts:3027, src/plugin.ts:4810, src/loop/core.ts:1300;
endsWithAnnouncement 6 hits; endsWithDraftClose only its definition;
MYSQL_SCHEMA_VERSION 11 at src/storage/mysql.ts:77).

Suites: issue5175 66/0, tag-echo 79/0, issue2190 32/0, issue3905 19/0,
issue7318 6/0, issue2929 1/0, native-compact-terminal 1/0,
notice-registry 5/0, plugin-fork 58/0, issue5403 1/0, issue4666 2/0,
issue4739 4/0, issue4788 4/0.
Louie0806 added a commit to Louie0806/billion-context that referenced this pull request Nov 21, 2026
Brings in PR ranxianglei#7415's follow-up batch: a kernel compress receipt that no
longer double-claims a batch seam, third-party scan hardening, and the
per-turn pf window ledger full-path coverage.

Overlap with this branch is limited to the three generated configuration
docs, which auto-merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working p2 scope/wiring

Projects

None yet

1 participant