Repository navigation
[PR] compress-from-store: evicted sessions fold against the unified-store view instead of refusing forever (#3982) - #3983
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4895-pr.3983.2edcf35This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3983.tgz
npm install -g packageInstall instructions are refreshed on each push. |
0d1c951 to
63d17f5
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 全仓(含已关闭)检索失败签名「evicted session / REFUSED forever / peekStoredTailView / compress-from-store」:本 PR 是该机制的唯一实现。相关项对照:#3982(设计 issue,本 PR 即其落地)、#3918(P4 父任务,实测场景)、#3943(判决诚实化,正交——它管回执说真话,本 PR 管按钮能用)、#3859(no-visible-context guard 对活跃块重叠 range 的绕过,不同机制不同症状)。无并行同类 PR。 标签:bug + dsh + scope/kernel + p1(保留 pr)。理由:超常驻预算的会话 compress 永久拒收 = 核心承诺(上下文压缩)对该类会话结构性失效、上下文只增不减 → 按 owner 2026-10-19 修订归 p1;证据场景来自 dsh(#3918);改动域是 compress 拒收门(persist/stream/external-summary),归 scope/kernel。 状态:正在做独立审核——rebase 到当前 master、定向测试、逐段读 diff(含回归清点与测试有效性审查),结论按八问体例随后发出。 |
…ore refusing (#3982) - applyRanges + the external-summary gate recover the raw client view from the unified transcript (peek-only, read-only; any unparsable row keeps the honest #3126 refusal) when the effective view is empty - live views never consult the store; legacy/no-store refusals stay byte-identical - 4-test stake pins: recovery fold lands / no-store refusal / corrupt row refuses / live view untouched
…covered view (#3982 review)
63d17f5 to
37c0186
Compare
(ai: vllm-qwen/qwen3.8-27b) 审核结论(独立重审):未发现硬回归;一个设计问题待确认;旧 head 的 CI 红已根因定位并已处置。 ① 是什么问题:大到无法常驻内存的会话(超过 512MiB 常驻预算)每次请求后都被逐出,compress 永远撞「没有活视图」而拒绝,且回执还承诺「下一轮模型请求后自愈」——对这类会话是假的,按钮永久失效。本 PR 让压缩路径在拒绝前从统一存储恢复原始客户端视图,fold 得以落地。 ② 什么原因导致的:压缩路径只认内存视图( ③ 影响范围与严重程度:只影响无法常驻的大会话(正是目标人群);修复前这些会话的 compress 完全不可用(p1 级不可用);修复后 fold 直接落地。小会话/正常会话路径字节级不变。 ④ 怎么修复的:在 ⑤ 是否有回归问题(diff 触碰路径的既有行为逐项清点):
⑥ 是否破坏缓存:不涉及——前缀缓存/重试/增量游标策略未触碰;恢复只为单次 fold 决策提供输入,不改出站内容。 ⑦ 是否改了设计方向:不涉及架构转向,只是把压缩路径接到既有存储。有一个设计问题需确认(非阻塞缺陷):
⑧ 是否引入新配置:无。 行为变更披露:此前会「永久拒绝」的 compress 调用,现在在统一存储有可读行时会成功——这就是修复本身(旧行为即缺陷);其余拒绝路径与文案不变。 CI 状态:旧 head(63d17f5)CI 红 = 5 个 shard 失败,根因两类:① #3769 已知 flake(master 765abe3 已修,属 stale base);② 新测试文件 2 个失败(recovery 返回 null / index.db 缺表)——本地连续 13 次运行(含原始 head 与两次 rebase 后 head)全部 4/4 通过,家族回归 88/88 + 存储/快照 31 pass/1 skip,typecheck 干净,判为 CI 环境特异的非确定性失败,本地不可复现。已 rebase 到当前 master(bc4a3f8)并推送,新 head 37a65bc(含重构 commit),等新 CI 裁决。 收工判定:方向正确、无硬回归;等新 CI 绿后可合入;建议先确认⑦的口径问题(若选 (b) 请补测试后再合)。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.711-master.02bc1b5 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Fixes #3982 (root fix for #3918 Phase 4 — the
compress REFUSED foreverloop on sessions too large to stay resident).What / 干了什么
peekStoredTailView(sessionId)(src/persist.ts): read-only recovery of the raw client view from the unified transcript. Peek-only — the module store singleton must already exist; never constructs a store on a compress path. Disabled/unavailable sidecar, zero rows, or ANY unparsable row → null (callers keep the honest refusal; never fold against a half-readable view).applyRanges(src/stream.ts) + the external-summary gate (src/external-summary-compress.ts): when the effective view (ctx.compressMessages ?? ctx.messages) is EMPTY, recover from the store before thenoVisibleContextRefusalgate. One info log line per recovery.Why cheap / 为什么便宜
The unified store already persists the full raw view on every save; this PR only wires the compress path to it. No kernel change, no persist-format change, no eviction-policy change (LRU untouched — #3943 makes the verdicts honest, this makes the button work).
Verification
tests/compress-from-store.test.ts(staked red-first): recovery fold lands with full coverage (m00010..m00040) / no-store refusal stays byte-identical ([bug] 大会话 compress 持续失败:ctx has 0 message(s)时所有 ref 被判悬空(cannot-anchor),报错归因误导 #3126) / corrupt CAS row refuses / live view never consults the store (coverage follows LIVE ids).