Repository navigation
[PR] fix: await unified snapshot writes and reset each debounce batch - #6186
Conversation
(ai: vllm-qwen/qwen3.8-27b) 查重 (dedup): Not a duplicate. Scanned all open [PR] threads — no other PR targets #6178 (the async write-lifecycle defect). Nearest neighbor is #5480 (immutable-journal publication), which touches the same two source files but a different mechanism; coordination note below. Labels: triage = Independent verification (redone locally at head
Test quality: both new cases have teeth and assert both directions of the gate (#3617 discipline): the durability case gates on deferred store writes and asserts shutdown does NOT proceed while any queued write is pending (including the flush's own write); the budget case asserts the second write does NOT fire early AND still fires at the normal debounce. Deterministic: mocked timer/clock APIs, deferred gates, env knobs saved/restored in Behavior changes (old → new, disclosed):
Coordination note (#5480): the open immutable-journal PR touches the same Auto-merge gate (§7.4): eligible — pure 结构化八问:
结论:可合。 修复最小且正确,回归测试钉得住原缺陷(本地负对照 4/4 失败 → 修复后 4/4 通过),CI 全绿。合并时请留意与 #5480 的顺序交互:后合的一方需要 rebase 并保留双方语义。 |
|
(ai: vllm-qwen/qwen3.8-27b) Follow-up from the issue-side triage (#6178):
|
(ai: vllm-qwen/qwen3.8-27b) Status confirmed against live state (not from memory):
Nothing new to add to the review. Verdict stands: ready to merge — the only remaining steps are yours (merge is human-only), with the standing caveat that whichever of #6186 / #5480 lands second must rebase and carry both semantics. |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1174-master.ca1e6c8 # this exact build
npm install -g billion-context@master # always the newest merged build
|
master moved past the previous sync (dc041dd) by the web handoff-render (#6260) + anthropic trailing-system (#5432/#5441) + snapshot-write-lifecycle (#6186) landings. None of those commits modify src/plugin.ts or src/agent/fork-adopt.ts (master's version of both == merge-base), so this merge is clean and preserves the #5123/#4266 union resolution untouched.
Master advanced past the dc041dd merged earlier (web handoff rendering, anthropic trailing-system tails #5432/#5441, snapshot write lifecycle #6186, handoff-render #6260). Clean auto-merge — none of those commits touch the side-lane surface (handle.ts / side-request.ts / side-lane tests), so no conflicts and no logic change.
… round 9) Master advanced 33104b1 -> c26c31a (ranxianglei#6260, ranxianglei#5441, ranxianglei#6186, ranxianglei#5774, ranxianglei#6166 et al.). Clean auto-merge, no conflicts: the new window's blockOps work (ranxianglei#5765/ranxianglei#6166) and this PR's decide-lane keys land in different regions of every shared file. Also completes the round-8 docs regeneration that was left unstaged: the committed head carried the decide-lane keys in the compress.yaml seed but not in the generated output. Re-ran node tools/gen-config-docs.mjs generate on the merged seed (341 entries; i18n ok: 256 keys, EN/ZH equal) — generated output now matches the seed in docs/configuration[.zh-CN].md, website/main.js and website/docs/index.html (blockOps + decide-lane keys, both languages). Verified: tsc --noEmit clean; unused-exports gate clean; targeted suites green (nudge-decide + issue3004 selfheal + config-surface-guard + nudge-model-decided e2e). Full-suite verdict = remote CI.
Fixes #6178
Problem
Both prefix-affinity and session-order await persistUnifiedNow during shutdown, but that helper returns void while the KV read/modify/write is still queued. Graceful exit or restart can therefore proceed before the snapshot becomes durable. The unified path also leaves pendingSince set to the first batch forever, so after its max-delay expires later mutations schedule immediate writes instead of respecting the debounce window.
Changes
Return the serialized KV promise to flush callers and reset the pending clock when the current batch takes ownership of its write. Later mutations receive a fresh debounce budget even if an older write is still settling. Both writers retain their existing merge, bounds and failure-demotion behavior.
Validation
e3220adc0f5412af83163666ca70a6afa05e3247(package version0.1.213). The intervening [PR] thirdparty-scan: flag dsh-live-compact as a known conflict (#5984) #6166 changes only third-party plugin detection, its tests, announcements and configuration docs; none of this patch's source or test files changed. The complete patch is byte-identical to the locally validated patch on33104b1f9545caeb0344193009917ceef9969682and applies cleanly.33104b1f9545caeb0344193009917ceef9969682: 4 new regression cases still fail before the production fix.33104b1f9545caeb0344193009917ceef9969682(92d15c3002258392fdc5f4007027f57bb703f2f2): 28/28 focused tests passed, with no failures, skips or cancellations.npm run buildpassed on the temporary integration treee186774d3428c85e2a4974c6e609b2a7381d6153containing the seven independently submitted fixes on33104b1f9545caeb0344193009917ceef9969682. The repository compiler options and include set are unchanged.git diff --checkpassed. Local runtime: Node.js 24.22.1 on Linux. Full cross-platform remote CI remains pending.The open immutable-journal work in #5480 changes legacy file publication; its unified helper still returns void. This patch fixes the shared async batch lifecycle without changing storage format, configuration or kernel code.