Repository navigation
[PR] fix: build block-content original cache from the complete source view (#6834) - #6852
ranxianglei wants to merge 3 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.11023-pr.6852.0b0a4ccThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6852.tgz
npm install -g packageInstall instructions are refreshed on each push. |
094545c to
d26591c
Compare
(ai: vllm-qwen/qwen3.8-27b) 🔶 需要决策 — 重复 PR:本 #6852 与更早的外部 #6837 是同一线程(#6834)的两个并行 PR,一字不差的同一行修复。 查重:重复 #6837(同症状+同机制+同一行修复)。 接单后我先列了 open [PR] 行,发现 PR #6837("fix: cache full compression input as block originals",作者 @ZhaoJun233,外部 fork,2026-11-15 14:25 开)同样
两者在 这正是「一个线程两个 open PR」会互相踩合并的场景。按先来后到 + 「外部贡献者 PR 直接修、不替换」,应保留更早的外部 #6837、本 #6852 为重复项。 对 #6852 本身的审核(我被要求核对的这条):
待决:同一 #6834 保留哪条、关闭哪条?
8问(结构化审核):
判定: 代码与测试本身可合(§7.4 代码层面满足、CI 0 红),但存在重复 PR——建议按选项 A 保留更早的外部 #6837、关闭本 #6852。等你拍板后我立即执行 rebase + 移植测试。 |
[bot] 🏷 CI 状态更正(我上一条回复说错了) 我上一条说 "CI: 0 失败 / 3 pending; mergeable" —— 错了。我查的是镜像缓存(upstream-checks API),但缓存过期了(fetched_at 2026-11-15T16:35:16Z,在 test 车道跑完之前抓的,所以显示 0 失败)。实时 GitHub check-runs(commits/d26591c0/check-runs)= 真相:50 个 check run,31 success,13 skipped,6 FAILURE(全是 test 车道)。 6 个失败的 test 车道(head d26591c):ubuntu24/shard2、ubuntu24/shard3、windows22/shard5、windows22/shard1、ubuntu22/shard2、ubuntu22/shard3。 master 是绿的(f648217cb:14 success,0 failure)→ 这 6 个失败不是继承的,是 PR 引起的(或 flaky)。 失败的测试(跨 6 个 shard,全是 persisted-state / DECOMPRESS / golden 类):
根因:PR 的一行修复( 关键发现:scenario A/B 的失败是 DECOMPRESS 断言(不是纯 golden 过期)—— PR 的改动改变了 decompress 行为。PR 描述里已 flag 了 "Reasoning-drop case"(缓存现在包括 display view 丢弃的 reasoning),所以这可能是预期行为变更(不是回归),但:
PR 作者只跑了 5 个 targeted suites(proxy-decompress-cache、refold-wiring、issue3307-fold-view-basis、compress-from-store、issue6834),没跑这些 golden/decompress 回归测试 → PR 当前不完整,CI 红,不可合并。 修正后的结论:修复方向正确(#6834 的根因确实是一行 view 选择),但 PR 需要补上 golden 重新生成 + scenario A/B 测试更新 + 确认 decompress 行为变更是预期的(不是回归)。在此之前,不可合并。 (教训:镜像缓存会过期,CI 状态必须查实时 GitHub check-runs,不能只看镜像。) |
[bot] 🏷 Review conclusion (final summary) I reviewed PR #6852 "fix: build block-content original cache from the complete source view (#6834)". Verified:
CI (corrected from my earlier reply):
Root-cause: The PR's change alters the CCR store (block-content original cache) → changes persisted state AND decompress output → golden/snapshot + decompress assertions fail. The PR description flags the "reasoning-drop case" as a behavior change → likely an expected behavior change (not a regression). What remains (risk):
Duplicate PR note: PR #6837 (external, earlier) has the same one-line fix → same CI issue. Both PRs need the CI fixed first, then decide which to keep. Conclusion: The fix direction is correct (#6834's root cause is indeed the one-line view selection), but the PR is incomplete (CI red, needs test/golden updates). NOT mergeable as-is. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) CI fixed — all 54 checks green on new head What was red, and why (verified, not inherited)The 6 failing test shards were all caused by the PR's own commit
Fix (2 commits, pushed to the PR branch)
Verification
Note: 八问
|
ad77ed1 to
e6b29d1
Compare
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Conflict resolved — PR rebased onto current master, CI fully green on new head What happenedMaster moved two days ahead ( What I did
Note: 八问
收工判定: 冲突已解、CI 全绿,本车道完成; |
e6b29d1 to
209b1d1
Compare
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Conflict resolved — PR is now mergeable. The blocker was a merge conflict ( What I did this run:
Live state: 八问
判定:冲突已解决,PR 现 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) The merge conflict was already resolved in the previous run — no new work needed this run. I verified it live before acting. What I did this run (verification only, no code/push):
The previous run rebased onto master head 八问
判定:冲突已解决(上轮完成),本轮验证确认无真实冲突、CI 全绿,无需进一步操作。GitHub API 的 |
…#6834) After emergency truncation clips the middle of large tool-results in the display view (ctx.messages), the block-content ORIGINAL cache still preferred the nonempty display view over the complete raw resend (ctx.compressMessages). applyCompression folded from the complete source, but the cache cached the clipped text — so a later whole-block full decompress served incomplete originals even though the fold had the complete source. Use the same view for both application and original caching (ctx.compressMessages ?? ctx.messages). No kernel change. Prevents new clipped caches; does not rebuild old ones. Adds a regression test that arms real emergency truncation, compresses a range spanning the clipped tool-result, clears both live views, and asserts the full restoration keeps the checksum in the clipped middle.
The #6834 one-liner (contentSource = compressMessages ?? messages) also switched the plugin-tool lane's original cache from the tagged processed view the model saw (mem.processed) to the raw client history (mem.original), which carries no ACP tags — a full decompress then returned originals without citable refs, breaking the session- continuity proof (scenarios A/B: 'decompress must return the folded original m00005'). Decouple the cache source from the fold view: new optional RewriteCtx/LoopCtx.blockContentSource, set by the plugin-tool lane to the tagged processed view (restores master behavior there); the relay loop keeps caching from the complete raw resend (the #6834 fix).
…ange Rebased onto master a446a3c (master moved the same digests via #6947 reply-stash-out-of-messages-table and #6775 persisted fields). Regenerated on the rebased code with the official script (node --import tsx scripts/update-storage-render-goldens.ts): only stateDigest/stateDigestAligned and the blockContents section digest moved on all four wires; state/stats/metadata keep master's values and wire turn digests are byte-identical.
209b1d1 to
945a76b
Compare
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Conflict resolved this run. Master moved 21 commits ( What I did:
Live state: local proof definitive — 八问
判定:冲突已解决并 force-push(新 head |
Closes #6834
Problem
After emergency truncation clips the middle of large tool-results in the display view (
ctx.messages), the block-content ORIGINAL cache still preferred the nonempty display view over the complete raw resend (ctx.compressMessages).applyCompressionfolded from the complete source, but the cache cached the clipped text — so a later whole-block full decompress served incomplete originals even though the fold had the complete source.Fix
Use the same view for both application and original caching:
ctx.compressMessages ?? ctx.messages(src/stream.ts). The cache now stores what the fold actually folded. No kernel change.This prevents new clipped caches; it does not rebuild old clipped caches or invent absent source data. Normal full restoration remains unavailable for already-clipped cached content.
Behavior change (flagged per owner policy 2026-09-22)
In the relay path (where
ctx.compressMessagesis set), the block-content cache source changes from the display view (ctx.messages) to the complete source (ctx.compressMessages):Config surface
N/A — no config field added/renamed/re-semantics'd.
Validation
tests/issue6834-emergency-truncate-block-cache.test.ts(2 tests): arms real emergency truncation, compresses a range spanning the clipped tool-result, clears both live views, asserts the full restoration keeps the checksum in the clipped middle. Fails on unfixed master, passes with the fix.