Repository navigation
[PR] feat(zcode/claude/kimi): make the lane proxy-respawn watchdog cadence configurable (#4006) - #4366
[PR] feat(zcode/claude/kimi): make the lane proxy-respawn watchdog cadence configurable (#4006)#4366ranxianglei wants to merge 2 commits into
Conversation
c16e4da to
9e1b7c8
Compare
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.5307-pr.4366.bec71bcThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4366.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 —— open+closed issue/PR 检索「watchdog / respawn cadence」无并行工作项;本 PR 是 #4006 方案 A(做成可配置)的唯一实现,且与 #4367/#4368/#4369(#4006 附带观察的立项)机制不同、互不重叠。 标签: zcode + claude + kimi + scope/wiring + p2(三条 lane 的 MCP entry 看门狗属客户端接入层;严重度与 #4006 自身 triage 一致——可用但有明显恢复延迟)。 这是本 daemon 此前在 #4006 交付的 PR,本次按 [PR] 唤醒做复核:已取回分支读完全部 diff(12 文件 +155/−17),正在把分支 rebase 到当前 master 后本地跑 typecheck + 定向测试,随后核对 pushed head 的 CI 状态并给八问结论。 |
9e1b7c8 to
5e9adb0
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复(首轮回复已声明,此处不展开)。标签:pr / zcode / claude / kimi / scope/wiring / p2(已打,理由:功能 PR、三车道看门狗接线、非破坏性)。 Review 结论独立审核:通读全部 diff(12 files +155/−17)。方向正确——#4006 选项 A(做成可配置)落地为 canonical knobs 机制(#2030),三车道共享一对 knob(同一机制族,单一事实源 发现的缺陷(已修):原 head 9e1b7c8 的 CI 三个 guard job 红——
本地验证(定向,全绿):config-surface-guard ✓ / lifecycle-ledger-guard ✓ / check-coverage ✓(181 env + 59 top-level keys)/ docs-sync 模拟(generate 后四产物零 diff)✓;typecheck 干净;三个目标测试文件 50/50 通过;build 成功且 knob 已内联进 dist 三条 lane 入口 bundle。 CI 状态:新 head 5e9adb0 的运行批次目前整体排队中(今日 runner 池拥塞,ci.yml 注释里提到的 "447-run queue incident" 就是今天的事)。三个原红 guard 我已在本地逐一复现转绿,预期 CI 无意外;跑完我会跟进确认并回帖。另观察到 force-push 瞬间产生一个 event=push 的零 job 失败 stub run(ci.yml 的 push 触发器并不匹配本分支,疑似瞬时触发伪影),未出现在 PR check 汇总里,持续观察。 结构化八问
判定:CI 在新 head 5e9adb0 上转绿后即可合并(合并由人执行)。CI 结果出来我再跟一条。 |
87e9037 to
86bb776
Compare
(ai: vllm-qwen/qwen3.8-27b) 上游 PR 冲突已解决 —— 本 PR(#4366,实现 issue #4006「把 zcode/claude/kimi 三条 lane 的看门狗节奏做成可配置」)已从旧 master rebase 到最新 master,现在可干净合并。 八问:
收工判定:冲突已清除,可合并性已恢复;新 head |
1295a57 to
45d9126
Compare
(ai: vllm-qwen/qwen3.8-27b) 进度更新:又发现并修掉一个 master 自带的红灯(与 #4006 改动无关,但会卡住所有在途 PR),最终判定等本轮 CI 绿。 lock-sync 红灯根因:f7d5e86d8(#4292)把 in-repo kernel 版本 bump 到 0.0.160,但没有重新生成两个 lockfile,两边都还记着 0.0.159——
已在 origin/master 本地复现确认是既有问题;出站查重:无既有 issue/PR。按几行级小修纪律直接在 PR 分支修掉:commit 45d9126 把两处记录同步到 0.0.160(纯机械同步,不碰任何 kernel 源码、构建配置或版本字段;Rule 2 版本纪律不受影响——无 src 变更、无版本变更)。 两个配套动作:
提醒:在这个漂移修复合入之前,所有在途 PR 的 lock-sync 都会红(master 自身即此状态)。 等 24d533b 上 CI 全绿后给最终判定。 |
24d533b to
d27c793
Compare
(ai: vllm-qwen/qwen3.8-27b) 进度更新(接上条):
CI 正在新 head(d27c793af)上跑,全绿后我发最终结论(八问体例)。 |
… configurable (#4006) The per-session MCP entry watchdogs (zcode #1145, claude #1821, kimi #963) hardcoded a 30 s probe tick x 3 failures, so an externally killed lane proxy took up to ~90 s to respawn (64 s measured in #4006). Both constants now resolve env > file > default through knobs.ts: - BILI_WATCHDOG_INTERVAL_MS > watchdog.intervalMs > 30000 (floor 1000 ms, so a seconds-vs-ms typo cannot hot-loop the local probe) - BILI_WATCHDOG_FAILURE_LIMIT > watchdog.failureLimit > 3 Defaults are unchanged — the knobs only add an escape hatch. intervalMs is read once when the watchdog arms; failureLimit per tick. Documented in CONFIGURATION.md en/zh.
…IFECYCLE ledger CI gates (config-surface-guard / lifecycle-ledger-guard / docs-sync) require new config surface to land via the YAML seed, not hand-edited generated tables: - process.yaml: watchdog block + intervalMs/failureLimit leaves (env twins), regenerated CONFIGURATION.md en/zh param-ref + env-map rows and the site tables (website/main.js, website/docs/index.html) - LIFECYCLE.md: new §2.10 permanent-registry entries for the two BILI_WATCHDOG_* vars Hand-written detail sections in both CONFIGURATION files stay as-is (outside the generated blocks).
d27c793 to
18f2fde
Compare
Closes #4006
What
The three per-session lane watchdogs (zcode #1145, claude #1821, kimi #963) hardcoded
WATCHDOG_INTERVAL_MS = 30000/WATCHDOG_FAILURE_LIMIT = 3. After an externally killed lane proxy (e.g. ZCode's process-tree cleanup in #4006), recovery took up to ~90 s (64 s measured). This makes both values configurable through the canonical knob machinery (#2030):BILI_WATCHDOG_INTERVAL_MSwatchdog.intervalMsBILI_WATCHDOG_FAILURE_LIMITwatchdog.failureLimitThis is option A from #4006 (做成可配置, labeled 最佳). All three lanes share the one knob pair — same mechanism family, single source of truth in
src/knobs.ts(laneWatchdogIntervalMs/laneWatchdogFailureLimit).Config surface (owner-gated area — reported per discipline)
watchdogwith two numeric fields + twoBILI_*env twins.network.*is upstream transport timing read by the proxy,update.*is the self-update cycle,guardrailsis pi/omp tool output. No existing key reaches "how fast does an entry respawn a dead lane proxy".zcode.watchdogIntervalMs, …) — rejected: identical mechanism across lanes, tripled surface for no semantic difference.KNOWN_TOP_LEVEL_KEYSupdated so the block does not trip the unknown-key warning.Behavior-change disclosure
None by default: with no env/file setting, all three lanes behave exactly as before (30 s tick × 3 failures). New semantics are (a) users can now shorten the window (e.g. 5000/3 → ≤15 s worst case; 1000/1 → ~1 s), and (b) out-of-range input falls back to the default instead of being applied (interval < 1000 ms → 30000; failureLimit < 1 → 3) — a typo guard, documented in CONFIGURATION.md en/zh.
Tests
tests/knobs-config-precedence.test.ts: full precedence matrix for both knobs (default / file tier / env-wins / garbage / floor).tests/zcode-mcp-entry.test.ts: a tick without injected failureLimit resolves the knob live from env.tests/claude-mcp-entry.test.ts: same for the tick, plus a real-timer test provingstartWatchdoghonorsBILI_WATCHDOG_INTERVAL_MS(respawn within ~3 s at the floored interval; the default 30 s tick never fires inside the test window).kernel/: the early version of this branch carried a mechanical lockfile sync (kernel/package-lock.json still recorded 0.0.159 while the in-repo kernel/package.json had been bumped to 0.0.160 by f7d5e86/#4292). That fix already landed on master via #4416 and this branch is now rebased onto it — the current head touches NO files under kernel/** (no source, no build config, no version field); kernel-guard is not triggered.