Repository navigation
Conversation
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 本 PR 直接对应源 issue #6490(同作者,描述同一机制、同一修法);全库搜索 Verdict: LGTM — mergeable after rebase to master. I independently reproduced the bug, verified the fix is a strict semantic equivalence, and re-ran the suites. What I verified
Regression review — existing behaviors of the touched path
Test quality
Notes
八问
结论: 可合并(先 rebase 到当前 master)。 |
…ent limit (ranxianglei#6490) Same mechanism as the reconciliation fix in this PR: Math.max(...ptrs) spreads the session's full canonical-pointer list (one entry per settled canonical message) into a single call, which trips V8's argument-spread limit (~125K-130K args on Node 22/24 x64) -> RangeError. The error is caught and only logged as a warn, so the failure is silent: the pointer list stops advancing and every later turn re-parses rows from the stale max pointer instead of the fresh tail. Replace the spread with a two-argument reduce (initial 0 - pointers are verified non-negative by readCanonicalPointers) and export the function for the regression test, which pins 150,000 pointers: pre-fix it fails with the RangeError warn, post-fix it passes and the upkeep reads rows after the highest pointer.
bfbd9f9 to
b8545db
Compare
The CI preload selects legacy storage, so the canonical-pointer fixture must opt into the unified store before setting session extension data. Restore the prior mode and close the SQLite handle before removing its temporary directory, including on Windows. Retain the existing canonical-pointer fix and integrate current master.
(ai: vllm-qwen/qwen3.8-27b) Re-verified live: the red CI reported by this event is already fixed — no further work done this run. What I verified in this run:
All checks green; 八问
结论: 无需进一步操作——事件报告的红 CI 已被前一轮修复,当前 head 全绿,等待人工 review/merge。 |
(ai: vllm-qwen/qwen3.8-27b) Status after restart — no new work needed.
Nothing further to do on the CI side. |
The suite baseline preload (preload-storage-baseline.mjs) pins BILI_STORAGE_UNIFIED="legacy" for the broad corpus. After ranxianglei#6480 flipped the storage default to pure-sqlite, the notice-registry suite's visibleNotices assertions expect the pure-sqlite default notice, which is gated on unifiedSelectionIsSqlite (unified "sqlite" or absent) — the preload's "legacy" made the notice silent, so the suite was born-red on master. Pin the selection explicitly (ranxianglei#4011 lesson: a test that depends on the production default passes locally but fails in CI).
…test The dsh plugin lane (ci-e2e-dsh.yml) runs node --import tsx --test WITHOUT the preload-storage-baseline.mjs preload, so BILI_STORAGE_UNIFIED is unset and the storage mode defaults to 'full'. Under the pure-sqlite default flip (5a80e2b, ranxianglei#6480), 'full' mode turns the JSON envelope writer OFF — so the .content-store.json sidecar is never written, and the test's readdirSync(namespace) hits ENOENT. Pin BILI_STORAGE_JSON_WRITER=on in the test so the content-store sidecar is written regardless of the storage mode. This keeps the corrupted-store detection path exercised in both full and legacy modes. Closes: dsh plugin lane red on master (run 43532980164, job 132255459726)
The pure-sqlite default flip (5a80e2b, ranxianglei#6480) turns the JSON envelope writer OFF, so the .json session file this lane asserts on is never written and 'proxy must persist the session' / 'no persisted session carried compressed blocks' fail after the 20s wait. Pin the writer ON in the spawned client's env (the bootstrapped proxy inherits it) so the envelope this test was written for is still produced. Closes: native opencode lane red on master (run 43547593803, job 132302438610)
Same pure-sqlite default flip (5a80e2b, ranxianglei#6480) as the opencode lane: the JSON envelope writer is OFF, so 'proxy must persist the session within 20000ms' fails — the on-disk .json session file is never written. Pin the writer ON in the spawned dsh client's env (the bootstrapped proxy inherits it). Closes: native dsh lane red on master (run 43547497015, job 132302138843)
…e2e lane Same pure-sqlite default flip (5a80e2b, ranxianglei#6480) as the opencode/dsh lanes: the JSON envelope writer is OFF, so 'session persisted' fails — the on-disk .json session file is never written. Pin the writer ON in the spawned pi client's env (the bootstrapped proxy inherits it). Closes: pi codex-responses WS lane red on master (run 43547626291, job 132302540960)
…lane 4th lane of the pure-sqlite default flip (5a80e2b, ranxianglei#6480) family: the JSON envelope writer is OFF, so 'proxy must persist the session' and 'at least one persisted session must carry compressed blocks' fail — the on-disk .json session file is never written. Pin the writer ON in the spawned pi client's env (the bootstrapped proxy inherits it). Closes: pi package-native lane red on ci-fixes (run 43558179054, job 132336647955)
Same pure-sqlite default flip (5a80e2b, ranxianglei#6480) family: the JSON writer is OFF, so the per-session CCR content-store sidecar (.content-store.json) that 'child persists its own companion and survives a proxy restart' asserts on is never written (0 !== 1). The earlier b1bc17b pin only covered tests/plugin-fork.test.ts, not this file. Pin the writer ON at module load (before any SessionStore is constructed). Closes: dsh plugin lane red on ci-fixes (run 43558179102, job 132336519539)
…lane Pure-sqlite default flip (5a80e2b, ranxianglei#6480) family: the JSON envelope writer is OFF, so 'proxy must persist the session' fails — the on-disk .json session file is never written. Pin the writer ON in the spawned opencode client's env (the bootstrapped proxy inherits it).
Pure-sqlite default flip (5a80e2b, ranxianglei#6480) family: the JSON envelope writer is OFF, so the on-disk .json session envelope this lane asserts on (exactly ONE persisted session under the raw key) is never written. Pin the writer ON in the spawned dsh client's env.
Pure-sqlite default flip (5a80e2b, ranxianglei#6480) family: the JSON envelope writer is OFF, so the on-disk .json session file this lane asserts on (state survival across the OLD→NEW update) is never written. Pin the writer ON in the spawned proxy's env (both update phases share envBase).
The BILI_STORAGE_JSON_WRITER pin landed with a stray leading space (9-space indent) against the surrounding 8-space env properties. Mechanical style fix from review; no behavior change.
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: qwen3.8-27b/qwen3.8-27b)
APPROVE — the core fix is correct, behavior-preserving, and well-pinned by regression tests.
What I verified (independent of the issue's own analysis):
-
Core fix is correct.
planReconciliation(src/fold-reconcile.ts) collected every claimed index intoclaimedIdx[]and then ranMath.min(...claimedIdx)/Math.max(...claimedIdx). Past ~125K–130K claims the spread exceeds the engine's argument limit and throwsRangeError: Maximum call stack size exceeded. The fix replaces the array+spread with an incrementalminClaimed/maxClaimedupdated in lockstep withplan.byPos++in the head and tail scans. I traced the only consumption site (thefenced && gap.oldIdx > minClaimed && gap.oldIdx < maxClaimedbracket test): with zero claims the predicate is false under BOTH the old-1sentinel and the newInfinity/-Infinitysentinels, and with claims present the incremental min/max is identical to the spread result — so the change is behavior-preserving, not just crash-avoiding.recordCanonicalPointers(src/incremental-lane.ts) had the same unboundedMath.max(...ptrs)and is now areduce(seq pointers are ≥ 0, init 0 is safe). The one remainingMath.max(...vals)insrc/web/sessions-data.tsoperates on the boundedcalibrationRing(capped byCALIBRATION_SAMPLE_WINDOW), so it is safe and correctly out of scope. -
The regression tests have teeth.
tests/fold-reconcile-large-history.test.ts(150,001 reminted msgs + a mid-history gap) andtests/issue6490-spread-argument-limit.test.ts(150,000 canonical pointers) both fail withRangeErroron the pre-fix code (I checked outorigin/master'sfold-reconcile.tsand reverted thereduceto confirm) and pass on the fix. The author's follow-uptests/inc-canonical-pointers.test.ts(250K pointers, first/last swapped to exercise the highest-row path) also passes. I ran the full fold-reconcile suite: 118 pass; the 4 failures inlineage-reconcile-boot.test.ts(AC9–AC12,parent must have folded a block) are pre-existing on master (0 pass / 4 fail there too), unrelated to this PR. -
Stale base is resolved. The branch was 17 commits behind master and conflicted in 9 test files (all in the
BILI_STORAGE_JSON_WRITERpin area, which master already carries from #6480). The author merged master into the branch (6f7916fa80) and the PR is nowmergeable: true. The diff against master is clean: the two source files + three test files, nothing else. -
No kernel change, no config-surface change, no wire/behavior drift. The sentinel change (
-1→Infinity/-Infinity) is internal to the bracket computation and does not alter any outbound wire shape, persistence format, or default.
8问 (结构化审核):
- 是什么问题: 超长历史(>125K 条消息)的 fold 对账在计算 claimed 区间极值时用
Math.min(...)/Math.max(...)展开大参数列表,超出引擎参数上限抛RangeError,对账直接崩溃。 - 什么原因导致的:
planReconciliation先把所有 claimed 下标收进数组,再用 spread 求 min/max;spread 实参数受引擎限制(约 125K–130K),超长历史越界。recordCanonicalPointers的Math.max(...ptrs)同因。 - 影响范围与严重程度: 仅触发于超长历史(>125K 消息)会话;常规历史不受影响。属「特定条件下有问题」——超长历史对账崩溃,非全局不可用。
- 怎么修复的: 把「收集数组 + spread 求极值」改为扫描过程中增量维护
minClaimed/maxClaimed(head/tail 扫描与plan.byPos++同步更新);指针侧Math.max(...ptrs)改reduce。不展开大数组,从根上消除参数越界。 - 是否有回归问题: 无。sentinel 由
-1改为Infinity/-Infinity:零 claim 时 bracket 条件在两种 sentinel 下均为 false,有 claim 时增量极值与 spread 极值恒等,行为逐格保持。fold-reconcile 全量套件 118 pass,4 个 fail 为 master 既有(与本 PR 无关,已对照验证)。 - 是否破坏缓存: 不涉及。
- 是否改了设计方向: 不涉及。纯机械修复,不改架构/边界/数据流/线格式。
- 是否引入了新的配置: 不涉及。
已顺手修:tests/e2e/e2e-native-pi.test.ts env 块缩进对齐(9→8 空格,与相邻属性一致)+ commit 9304052559(该改动已被作者合入 master 的收敛覆盖,无行为影响)。
[bot] 🏷 (ai: qwen3.8-27b/qwen3.8-27b) Review complete: APPROVE (review id 5903287758) What I did:
8问:
判定: 可合。 |
[bot] 🏷 (ai: qwen3.8-27b/qwen3.8-27b) Re-review: head 04f998b confirmed — APPROVE stands (review id 5903287758). The head moved 8b278fc → 04f998b (author's master-merge 6f7916f + new test 04f998b). I re-verified this exact head:
No new changes since my last review. The master commits in the branch log (9495c76, f31b710, c26e001, etc.) are pulled in by the author's merge, not new PR changes. 8问:
判定: 可合。 |
|
Superseded by #6677 (merged as Landed into master via the real merge commit The fix for #6490 is now in master. Closing this PR as superseded — thanks for the careful, well-tested fix. |
… into batch5-wave5
Closes #6490
Problem
A long session can fail reconciliation even when almost all re-minted message IDs have verified positional matches. The gap-resolution pass expands every claimed index into Math.min/Math.max arguments; 150,000 claims exceed the JavaScript engine's argument limit and throw RangeError before the folded history is reconciled.
Change
Maintain the smallest and largest verified indices as the head and tail scans claim positions. This removes both the unbounded argument list and the temporary claimed-index array. Existing fingerprint, role, length, content and no-evidence rules are unchanged; an unbracketed gap remains unmatched.
Initial validation
Prior work and tracking
Checked all 61 Afloat16 PRs, all 160 fork branches, the full fold-reconcile history and upstream issue/PR searches for claimedIdx, reconciliation/argument limits and call-stack failures. #6246 fixes plugin-render's fold-anchor placement, a separate endpoint; it does not cover this reconciliation pass.
Earlier master integration
Merged upstream master
fcc2e848486cc2152e36b6658c517fbfa51ec428into this branch without textual conflicts. The published merge commit is2f2fe73d838f312f29e0c28db99b1dc795d86fd6, with the original PR heada731d247dce8d2a84dea844ff330287069d3c87aas its first parent and that master commit as its second parent.The reconciliation fix and its regression test file are byte-for-byte unchanged from the first parent; this update adds the upstream history available at that point.
Integration validation on Linux x64 / Node 24.22.1, after installing the locked dependencies:
npm run typecheck,npm run build,npm run check:unused-exports,npm run check:test-import-graphandgit diff --checkpass.1af4d299ce5c3b9a097f25850cb2c7c6243a9598exactly matches the locally tested tree.The integration commit triggered hosted CI run 43377348655; its result is available there. Complete hosted CI and real-model E2E are not claimed as passed by these local integration checks.
Follow-up for the canonical-pointer CI regression
Retained the additional canonical-pointer fix in
b8545db19c86260036cd4e486fdf29f8ade6be13. The same argument-spread failure also affected incremental-lane pointer upkeep; that change replaces the unboundedMath.max(...ptrs)call with a two-argument reduction.Run 43393897505 exposed a fixture error on Ubuntu / Node 22, Ubuntu / Node 24 and Windows / Node 22: the repository preload selects legacy storage, so the new test's
setSessionExtcall failed before exercising pointer upkeep. The fixture now explicitly selects full unified storage, restores the previous mode afterward, and closes the SQLite handle before removing its temporary directory. No production code was changed by this follow-up.Published
5e1972e52e49d7cf79a66d282f33efa609cf6c91, preservingb8545db1as the first parent and integrating upstream master99c22d283f2fbadb3dc428980dfdc5adc5fcd277as the second parent. The tested and published tree is37cdd1bd5f0a2ad4239997568e1aa78b77768b2d.Validation on this tree:
Math.max(...ptrs)expression makes the repaired regression test fail on the argument-limit assertion; the production fix was restored afterward.npm run typecheck,npm run build,npm run check:unused-exports,npm run check:test-import-graphand the net diff whitespace check pass.Hosted CORE CI run 43396508736 completed successfully on this head: all 27 executed jobs passed. The canonical-pointer regression passed on Ubuntu / Node 22, Ubuntu / Node 24 and Windows / Node 22. Its tested merge tree exactly matches the published tree above. FULL CI and real-model E2E remain gated as described below.
Review status
Linked to #6490 and ready for maintainer review. The latest integration validation includes upstream master
99c22d283f2fbadb3dc428980dfdc5adc5fcd277, as recorded above. Current hosted results are available in the Checks tab.Please apply the existing
ci:fulllabel to run the FULL matrix, including the required Windows / Node 24 checks. The default CORE matrix does not produce those checks.Additional public-handler coverage
The complementary regression from #6658 is now retained here in commit
04f998bbfdf02d7ed31f40ee5028e5a257e8939e. It driveshandleIncrementalTurnwith 250,000 restored pointers, places the maximum pointer before the end of the list, and verifies both the incremental query frontier and the appended persisted tail. The existing two-argument reduction passes it without a production change.The canonical-pointer handler suite and the original #6490 real-storage regression pass 5/5 on this combined head.
git diff --checkpasses. This follow-up changes only the test file; hosted CI for the new head is pending.#6658 duplicates the pointer production fix already present here and is being closed. Its additional coverage is preserved rather than counted as a separate improvement.