Repository navigation
fix: dsh plugin — stop the re-registration self-lock after a failed proxy respawn (#3380) - #3393
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3998-pr.3393.c294af5This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3393.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 这是 [PR] 镜像(PR #3393,分支 本 issue 是已完成工作的镜像,按规范不重做——现在做的是 PR 审核:拉分支核对代码、跑定向测试、查 CI 状态,最后按八问给结论。 |
…roxy respawn (#3380) A proxy-death/give-up path cleared register.toolsReady even though tool registrations belong to the host CONTEXT (they survive proxy death; execute closures read the live base, #983). The next successful respawn then forced a re-registration that DSH rejects ('tool X is already registered'), the retry loop burned the identical doomed failure forever (145x/h in the incident), toolsReady stayed false permanently, and every model request lost its x-bili-plugin* identity headers — wire mode, anonymous zero-fold ledgers, and 413 preflight_compress_failed on large sessions until the host restarted. - proxy-death paths no longer clear toolsReady (only the #2101 context-change path resets it); a respawn therefore restores identity with NO doomed re-registration flight - registration is idempotent: a name this process already holds is adopted instead of thrown on (converges partial/dirty states), logged once - consecutive failures escalate: capped exponential back-off (10s -> 5min, REG_RETRY_MAX_MS) + one loud client-event notice with the recovery action after 5 failures; retries never stop (#983/#2082) - /acp exposes wire-mode identity loss (warning line + last error) instead of staying silent; a previously-serving proxy reads as 'temporarily unreachable ... recovering', not 'install' - maybeRetry gate widened so a baseless-but-toolsReady state can still drive respawn/recovery Tests: tests/issue3380-dsh-rereg-selflock.test.ts (incident repro, idempotent adoption, back-off schedule + integration heal, one-time notice, /acp surface).
4eacd44 to
3cddfd9
Compare
(ai: vllm-qwen/qwen3.8-27b) 审核结论:可合并(待 rebased head 的 CI 全绿;其余门禁已全部通过)。 先说两个操作项:
既有行为回归清单(逐项结论):
独立追查的关键风险点(PR 未明说的):搁浅态(baseless + toolsReady=true)由谁驱动 respawn?detached 恢复定时器在 测试有效性:6 个新测试全部有牙——incident repro 直接钉住修法( 八问:
行为变更披露核对:PR 表格 5 项(latch 清除时机 / 重试节奏 / 失败提示 / /acp 输出 / adopt 日志)全部在代码中逐一确认,旧→新值与实际一致,无遗漏项。 证据:
判定:可合并。 rebased head 的 CI 转绿后即可合并:#3393 |
(ai: vllm-qwen/qwen3.8-27b) CI 状态更新(rebased head |
(ai: vllm-qwen/qwen3.8-27b) CI 全绿,最终判定:可合并。 ✅ rebased head 审核结论汇总(完整八问见上一轮回复):
可以合并了:#3393 (合并动作按规范由你执行。) |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.512-master.fa41483 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #3380
修的是什么
DSH 桌面会话运行中失去 bili proxy、且第一次 respawn 失败(onGiveUp)后,
register.toolsReady被连同register.base一起清掉。但工具注册活在宿主进程的工具层里,proxy 死了它们还在(execute 闭包读 live base,#983)。于是下一次 respawn 成功后被迫重注册,而 DSH 对自己已经注册过的名字一律拒绝(tool "compress" is already registered)——toolsReady 永远回不到 true,所有请求永久丢失x-bili-plugin*身份头:wire 模式、匿名零折叠账本、大会话413 preflight_compress_failed,重启 dsh 前不会自愈。事故现场同一失败按固定 10s 重试了 145 次/小时。查重:不重复。 #3177 是 host 层工具不可见的另一机制(已由 #3287 修);#2101/#2103 是反方向的 stale-true(本修复保留其重置路径);#2082/#2091 是本修复所依赖的恢复循环本身;#2708/#1268 分别是 pi lane 与 boot 期问题。
修法(疏不堵)
toolsReady——只有 dsh-native: apply() on a re-activated context doesn't reset register.toolsReady — tools stay registered only on the dead context #2101 的 context-change 路径才重置它。respawn 成功后身份头直接恢复,不再有注定失败的注册请求。REG_RETRY_MAX_MS具名常量,无新配置面);连续 5 次失败发一条醒目通知告知用户重启 dsh;重试永不终止——瞬态故障仍自动愈合(永久自降级正是 [dsh] nativeproxyEnvOrigin()把临时 origin 冻结进 BILLION_CONTEXT_PROXY,绕过 ensureProxyRunning() 的 instance 验活;工具调用全部 fetch failed,需重启宿主 #983/dsh中工具会突然消失 #2082 的 bug 类)。issue 原文 P2 建议「N 次后放弃」,此处有意保留后台重试,理由见上。/acp在 proxy 应答但工具未注册时明确给出 wire-mode 警告行(含最后错误与恢复动作);曾健康服务的 proxy 失联时显示「temporarily unreachable … recovering」而不是误导性的 install 提示。maybeRetry门放宽:baseless-but-toolsReady 状态现在也能驱动 respawn/恢复(旧合取门会把这种状态搁浅)。行为变更披露(旧 → 新)
toolsReady清除时机/acp输出adopted N pre-existing registration(s)回归审查(触碰路径的既有行为逐项过)
proxyEnvOrigin()把临时 origin 冻结进 BILLION_CONTEXT_PROXY,绕过 ensureProxyRunning() 的 instance 验活;工具调用全部 fetch failed,需重启宿主 #983 live-base execute 闭包:不变;if (register.base === base)):保持;本地(rebased head f766689 + 4eacd44):新套件 6/6;dsh-native / issue2082 / issue2101 / issue2187 / native-intercept 共 119/119 绿;typecheck + build 绿。全量回归交 CI(§7.2)。
八问