Repository navigation
fix+test(#2676): dsh durable-guard lane keeps fork adoption usable - #2686
Conversation
[bot] 🏷 Review 结论(结构化八问)
验证证据(本地,head de65fcf):typecheck 干净;定向 合并判定:代码与行为均通过审查,可合,但按 PR 自述顺序执行——先合 #2625,再把本 PR rebase 到 master(届时主 CI 会在最终 diff 上跑全量门禁);若直接以 stacked 形态合并,两个 PR 会进同一个 merge commit,master push CI 同样兜底,二选一由你定。无需改动,等 #2625 落地即可。 |
b663386 to
7082175
Compare
de65fcf to
da57464
Compare
[bot] 🏷 上游冲突已解决(结构化八问)
状态:force-push |
|
Heads-up for the rebase once #2625 lands: this PR branched from 9136c63, BEFORE the "express kernel-protected messages as null refs on the fork wire" refactor (b663386, now 7082175 on the rebased #2625). The dsh-guard test added here asserts |
[bot] 🏷 这个 rebase 已经做完了,不用你再动手:
现在只剩 #2625 合入 master(它目前 mergeable,base 略落后于 master,合并时顺手 rebase 即可);之后本 PR 可直接合,或按你习惯先对 master 再 rebase 一次让主 CI 跑全量——两者都可以走。 |
da57464 to
85d8c37
Compare
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.258-master.d5bee77 # this exact build
npm install -g billion-context@master # always the newest merged build
|
What
Stacked on #2625 (same mechanism family: kernel BLOCKED sentinel vs forkSnapshot invariant). Two commits:
fix(#2676): the forkSnapshot invariant error now names the offending message —raw/ref mapping inconsistent (msg i/N role=… tool=… ref=… rawId=…). The bare string gave no clue which of hundreds of snapshot entries broke the mapping (root-causing [bug]dsh 在191版本上或者说之前版本,分支(带上下文窗口)以及带上下文的子智能体会一直静默没反应 #2676 locally took hours to identify "msg 2/7").test(#2676): regression test for the dsh durable-guard lane path — a session bound tox-bili-plugin: dshwhose history contains anInstructions from:workspace-instructions carrier gets the kernel BLOCKED sentinel via the host-levelisMessageProtectedhook (dsh 车道:AGENTS.md(workspace instructions,user 消息形态)被折叠后从 wire 消失 —— 与 #2419 同类,但 #2428 白名单只覆盖 <available_skills> #2447), and snapshot/fork/child-parity must all stay usable.Why (evidence)
Local repro of #2676 (dsh 0.2.0-rc.2 headless, two-phase
--session-idresume +subagent_fork, deterministic fake upstream, bili built from v0.1.191 content): every run failed fork adoption with409 SNAPSHOT_UNAVAILABLE: raw/ref mapping inconsistent. Chain: dsh durable-message-guards pin carrier user-messages from folding → kernel assigns BLOCKED refs (byRef never holds them) → pre-#2625forkSnapshot()required a byRaw/byRef roundtrip for EVERY snapshot entry → threw → client degraded to raw replay without inherited compression state. With large parent histories that replay hits the preflight/overflow path (#2383 shape) — the "silently unresponsive" symptom reported for 分支/fork subagents on ≤v0.1.191.#2625's tests cover only the
protectedToolstrigger (ask_user_question pairs); the guard path (plain user messages protected by the host hook) was untested. New test: fails on unfixed master (verified against 7c993f9:409 SNAPSHOT_UNAVAILABLE), passes here. Targetedtests/plugin-fork.test.ts: 46/46 green; typecheck clean.Behavior change (flagged)
forkSnapshot error text:
raw/ref mapping inconsistent→raw/ref mapping inconsistent (msg …)— prefix preserved (existing regex assertions still match); consumers are the 409 response body and the client-side degraded warn line. Reason: diagnosability, no semantic change.Merge order
Base = #2625's head branch. If #2625 merges first, I'll rebase onto master so the diff is exactly these two commits. Closes #2676 once both land.