Repository navigation
fix: dsh attach — superseded recovery flights must not revert the registered origin - #3618
Conversation
|
chon冲突 |
(ai: qwen/qwen3.8-27b) 收到,开始 review PR #3618(修 #3616 dsh attach 竞态)。 查重:不重复 —— 检索 open/closed issue+PR 无同机制条目。注意 master 上已有相邻机制:#3544/#3562 的 当前状态:PR head 与 master 冲突(dirty),conflict-worker 已被转发做 rebase(floor 3)。我这边并行做代码审查 + 本地定向测试(dsh-native.test.ts 及相关 dsh 套件),rebase 落地后再核对 CI。结论按八问体例回复。 |
0b093bf to
1e591c0
Compare
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4263-pr.3618.056b285This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3618.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 上游冲突已解决(rebase 完成,force-push
|
(ai: vllm-qwen/qwen3.8-27b) 实测当前没有冲突,两处独立验证:
页面如果还显示红叉,是 force-push 后 GitHub 网页端合并状态缓存未刷新(它需要重新计算,稍等片刻会转绿)。 当前 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.549-master.07501b3 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #3616
Problem
The dsh attach-mode test
apply() attach mode: registers manifest tools verbatim…flakes on Windows CI: the tool call is answered by the previous test's still-alive mock (callsempty in the deepStrictEqual while the response text matched).Root cause
verifyAttachAndRecover()'s healthy-attach branch bindsstate.origin/register.baseunconditionally from the origin captured at flight start. The flight is armed byapply(), but nothing invalidates it when the world moves on:_resetRegisterForTest()(test isolation) — or a freshapply()(cordis deactivate/reactivate) — can run while the probe is still in flight. On a slow machine the late landing revertsregister.baseto the stale origin, and every toolexecutereads the LIVE base (#983), so later calls follow it there.The test-isolation instance of this race is exactly the CI failure; the same mechanism exists in production for a re-activation that lands mid-recovery (late writes from the previous context into the new one's register).
Fix — origin-plane generation token
originGencounter insrc/agent/dsh-native.ts.apply()and by_resetRegisterForTest().verifyAttachAndRecover()captures the generation at entry and re-checks it after each await; a superseded flight returns without writingregister/state.bootstrap()afterensureProxyRunning(a superseded spawn reports its landing but binds nothing).landingOwnsRegisterguards kept — they cover a different domain (same-world maybeRetry self-heal moving the register); the generation covers world changes.Behavior change (intended)
Old: an in-flight attach verify/spawn from a PREVIOUS activation could clobber the new activation's registered origin with the stale one when it landed late.
New: only the newest activation's recoveries may write the origin plane; superseded flights become no-ops (they still report their landing value to their own consumers).
Happy path unchanged: with a single activation and no concurrent recovery the generation never changes mid-flight.
Tests
#3616 apply() attach mode: a superseded verify landing must not revert the registered origin: holds mock A's manifest (the version probe and the registration source share the URL) so world 1's verify stays IN FLIGHT across the reset + second apply, then releases it after world 2 owns the register. Verified to FAIL on pre-fix code (AssertionError — the call answered by the stale mock) and pass with the fix. No timing luck: the hold makes the ordering exact.No config surface change. No kernel change. No version bump.