You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compressing two adjacent ranges in one batch makes both sibling blocks claim the same boundary tool pair (live incident: pi session 01a1f6ff) #7429
来源: PR #7428 (#7428) — companion issue recording the live incident that PR fixes (promised in the PR body, filed at review time).
Symptom (live, pi session 01a1f6ff, v0.1.216, 2026-11-20)
The model asked to compress TWO adjacent ranges in one call (the batch seam sits on a tool pair). BOTH sibling blocks (b100/b101) recorded the same two messages in directMessageIds — the compress call's own carrier pair at the seam. Their seq intervals overlapped (4694–4698 / 4697–4698), and a later fold then consumed b101 positionally although b101's ref range (m04513–m04515) lay completely OUTSIDE the newer block's range (m04469–m04511) — the "nested compression" confusion reported in the web UI.
Root cause
The no-overlap contract (no two active sibling blocks may directly claim the same message) was enforced on every path EXCEPT same-batch siblings: the coverage snapshot (collectCoverage) was frozen once before the batch started, so each range's projection judged "already covered" without seeing what an earlier sibling in the SAME batch had just claimed. The batch overlap check compares resolved (pre tool-pair-adjustment) spans, which are disjoint for adjacent ranges — the pair widening happens inside the projection, after the check.
Fix
PR #7428 — refresh the coverage snapshot at the top of the apply loop (first-come-first-served): the earlier range keeps the seam tool pair; the later range shrinks to its own new messages or becomes the #4521 idempotent no-op (warning, not an error; the batch survives). No binary split, no new config knob, no wire/protocol/storage change.
Status
PR #7428 open (kernel, human review tier). Regression test: kernel/tests/regression-batch-seam-double-claim.test.ts (red before / green after; 3 cases incl. the pre-existing-covering-block no-op wording case added at review).
Duplicate screening (查重): Not a duplicate. The only related items are the fix PR (GitHub #7428) and this companion issue (GitHub #7429 = mirror #7431). No other open issue/PR addresses this same seam double-claim bug.
Labels:bug p2 pi scope/kernel (kernel ledger-integrity bug in a pi session). Note: I initially applied p1 (cache-ref-rewrite class per owner 2026-10-19), but on reflection the user-visible impact is a display/correctness confusion in the web UI — the session remained usable, there is a workaround (don't batch two adjacent ranges whose seam sits on a tool pair), and the impact is localized. It is not a crash, data loss, session-unusable, or a direct cache leak / stale-cache / unbounded-growth. So p2 (functional defect with workaround + localized impact) is the more accurate class, and it matches the PR's own label.
The PR→issue linkage is established: the PR body ends with Fixes #7429 and names the companion issue.
The regression test kernel/tests/regression-batch-seam-double-claim.test.ts exists with 3 real cases (disjoint-claims invariant, no-op warning shape, pre-existing-covering-block wording) — red before / green after.
Activity
ranxianglei commentedon Nov 21, 2026
[bot] 🏷
Duplicate screening (查重): Not a duplicate. The only related items are the fix PR (GitHub #7428) and this companion issue (GitHub #7429 = mirror #7431). No other open issue/PR addresses this same seam double-claim bug.
Labels:
bug p2 pi scope/kernel(kernel ledger-integrity bug in a pi session). Note: I initially appliedp1(cache-ref-rewrite class per owner 2026-10-19), but on reflection the user-visible impact is a display/correctness confusion in the web UI — the session remained usable, there is a workaround (don't batch two adjacent ranges whose seam sits on a tool pair), and the impact is localized. It is not a crash, data loss, session-unusable, or a direct cache leak / stale-cache / unbounded-growth. Sop2(functional defect with workaround + localized impact) is the more accurate class, and it matches the PR's own label.Status (verified live just now):
kernel/src/compress.ts:const→letcoverage snapshot + refresh at the top of the apply loop + split no-op warning).Fixes #7429and names the companion issue.kernel/tests/regression-batch-seam-double-claim.test.tsexists with 3 real cases (disjoint-claims invariant, no-op warning shape, pre-existing-covering-block wording) — red before / green after.结构化八问 (structured 8-question review):
collectCoverage)在批开始前只冻结了一次(apply 循环里的const),所以同一批里靠后的 sibling 看不到靠前的 sibling 刚刚声明了什么。批前的 overlap 检查只比较解析后(tool-pair 调整前)的 span,对相邻 range 是互斥的——pair 的扩宽发生在投影内部、检查之后。于是 no-overlap 契约在除「同批 sibling」之外的所有路径上都被执行了。判定: 该 companion issue 是对线上事故的完整、准确记录;修复在 PR #7428(open、CI 中、human review tier、已用
Fixes #7429关联)。本线程无需新的代码改动——交付物即记录 + triage。等待内核 PR 的人工评审。