Repository navigation
[PR] fix: recover retained compression blocks against fork replay - #5970
Conversation
[bot] 🏷 查重: 不重复。Searched open+closed mirror issues/PRs and GitHub for the same mechanism (planForkAdoption eligibility vs kernel syncBlocks resurrection). Related-but-distinct threads: #5964 (DSH opaque fork snapshots adopted by raw ids — different mechanism) and #5971 (LiteLLM overflow-count parsing — the sibling overflow-format fix your body references as #5967/#5969). No other PR targets this thread. 标签: bug + p1 + scope/kernel — defect fix; fork inheritance losing retained folds is the "fork 继承被放弃" class (owner revision 2026-10-19 category ① → p1); the mechanism lives in host-side session core logic and is client-agnostic — the DSH lane has its own copy path and this change does not touch it, so no client tag. Review verdictI read the diff against current master and verified it against the kernel's own resurrection rule. The fix is correct, minimal, well-tested, and honest about its scope. Two pre-merge conditions remain: a fresh full-matrix green on a rebased head, and human review per your own draft intent. ① Issue direction — root cause, not symptomIssue #5968's diagnosis holds and the patch targets the producer, not a downstream symptom. Cross-checked against ② Regression inventory (existing behaviors on touched paths)
③ Code qualityMeets the bar — no rework needed. Comments explain why (short-view vs consumed), naming is clear, no dead code, en+zh doc section added in the right place. One micro-nit I am NOT asking you to fix: ④ Test qualityReal teeth, both directions (#3617 discipline): the short-view fixture uses a genuine syncBlocks deactivation (not a hand-set flag), asserts no source mutation via deepEqual, independent ownership, and an exclusion matrix covering expanded / partial-span / unrelated / blocks-disabled / tier-descendant; the CCR e2e is parameterized over shortView∈{false,true} with a JSON stateBefore compare. I proved the bite locally: swapping origin/master's ⑤ CI status (live-verified just before this reply)
⑥ Scope honestyYour review-scope caveats are appropriate and I concur: the synthetic regression proves this specific planner gap; neither issue nor PR claims it is the sole cause of every reported fork overflow; recovery of the original failing production branch is not verified; existing branch state is not migrated by this patch. Behavior-change disclosure is present (docs, both languages). No config surface, no kernel/ change, no schema migration — confirmed against the diff. 结构化八问(中文,供人工评审)
判定:代码与测试质量达标(外部提交从严清单全项通过,无需对齐重构),方向正确,修法打到根因,测试有牙且双向。可进入人工评审。合并前置条件两条:(a) rebase 到当前 master(848f59b)后拿到一次完整矩阵绿——当前 head 有 9 个 shard 被触发风暴取消,尚无全量绿判定;(b) 按 §7.4,fork 块资格属 session-binding 域,保持 draft→人工合并,我不代合。 |
…-carry regressions Ported from parallel PR ranxianglei#5979 (same fix for ranxianglei#5968; being consolidated into this PR): three unit cases not covered by this branch - applyForkAdoption deep-copy isolation (mutating the adopted child never leaks into the source session), the straddled counter for partial spans while the block is transiently inactive in the source, and covered-ref carry into the child numbering.
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 审核协调说明(与平行 PR #5979 的合并处理):
|
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) CI 状态更新(18:29Z 直读核实):新 head |
…anxianglei#5970 retained folds, ranxianglei#5978 anthropic egress tail, ranxianglei#5981 truncated compress receipt Advances the base from 33d4951 to 7d18b7a (15 commits, 35 files). Four files overlap with this lane: src/plugin.ts, src/server/relay.ts and the two generated docs. All four auto-merged; upstream added `noteTruncatedUpstream` calls inside the plugin pipelines it already touches, while the lane's strip gates live elsewhere in the same files. Notable upstream commits adopted: - 0f93793 feat(pi): pi.commands — configurable slash-command registration surface - 4f80702 fix: recover retained compression blocks against fork replay - 8c98898 fix(anthropic): never send an outbound body that ends on an assistant turn - adc863a fix: tell the model to re-issue a compress whose args were cut in transit - 38e6b07 fix: bound the lost-in-transit re-issue advice with the session breaker - d1b2d8f fix: 会话历史按真实维度拦死 — count gate + 32MiB ingest cost band - fa447f9 fix: exempt image-bearing bodies from the ingest cost band - 33bec44 fix(launcher): force-takeover the wedged same-lane proxy holding the canonical port - 2826c51 fix(launcher): field-tune wedged-takeover timings + quiet win32 ESRCH alarm
Fixes #5968
A short source request can deactivate retained compression blocks even though the complete original span returns in a fork. Ordinary replay through kernel syncBlocks reactivates that span, but planForkAdoption skips every inactive source block before checking the child, producing refs-only inheritance.
Judge retained blocks against the child's complete id set. Preserve explicit expansion and consumed-tier exclusions, activate independently copied eligible blocks, and carry tier descendants as inactive records. No source-session mutation, kernel change, config field, schema migration or DSH parentSession change.
Validation
Review scope
Create this PR as DRAFT initially. This changes fork block eligibility and needs human review. Synthetic regression proves this specific planner gap; neither the issue nor PR claims it is the sole cause of every reported fork overflow. Actual recovery of the original failing production branch has not been verified. Existing branch state is not migrated by this patch.
Source data remains independent. Explicitly expanded blocks and incomplete/cross-boundary spans are not reactivated. No raw user sessions, logs, paths or credentials are part of the submission.
Related overflow-format parsing fix is #5967 / #5969; the branches are independently reviewable. After one lands, update the other's nearby bilingual documentation hunk as needed.