Repository navigation
[PR] fix: v0.1.200 review follow-ups — self-heal guard, cold-load counter, JSONC audit + web editor - #3689
Conversation
A self-heal origin fetch started under activation N could resolve after the agent was re-activated (originGen bumped), and its stale origin was written unconditionally into the live register — the same class of bug as #3616, reachable through the bootstrap guard's return value. Snapshot originGen before the fetch and drop the write when the world moved on. A post-giveUp revival is still allowed by design (#983): only the gen check is added, giveUpSeq is deliberately not consulted.
logColdLoad printed session.stats.tokensSaved, but since #2734 nothing in the tree increments that counter, so the line always showed a stale zero (tests hand-set 42000 to fake it). Read the kernel's live counter state.stats.compressionCount instead — it starts at 0, is bumped on every fold, and round-trips with the persisted state.
auditStartupSummaryCredentials read the config file with strict safeReadJson, so a JSONC config (accepted by the runtime loader since #3572) logged a bogus parse error and silently skipped the global external-summary chain at boot. Route the boot audit through loadConfigFile, which uses the tolerant parser and never throws. The per-route chain already went through loadRoutes and was correct.
The server accepts JSONC since #3572, but the web client still strict- parsed the draft in five places: quick-config hydrate, freshDraft, summary hydrate read(), save-quick and save-file. A user with a JSONC config saw the quick panel vanish (#3488) and could not save. Add one tolerant parser (strict JSON first, then comment/trailing-comma stripping) defined once in the TS module, inlined into the browser IIFE via toString(), and used by all five call sites. A genuinely broken draft still throws locally and the server's parseBiliConfig remains the authoritative check on save.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g [email protected]This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3689.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。检索了 open+closed 的 issue/PR(关键词:self-heal origin re-attach / maybeRetry generation、JSONC web editor quick panel、cold-load counter、credential audit JSONC)——无同签名条目。本 PR 引用的 #3616/#3572/#3488/#2734/#983 是它修复所依据的历史条目,不是并行工作;#3668 是被 review 的 v0.1.200 release PR,本 PR 是其 review follow-up,方向不同。 标签: bug + dsh + scope/wiring + p2(四项均为 v0.1.200 review 发现的缺陷;最重的一条是 dsh-native 自愈在 re-attach 后可能把死 origin 写进 live register,属客户端接线层;均可用但有明确问题 → p2)。 开始独立审核:已拉取分支 |
(ai: vllm-qwen/qwen3.8-27b) PR #3689 review 结论(v0.1.200 四项 review follow-up)四个修复逐一独立核验(读 diff + 核对上下游机制 + 本地定向测试),全部成立。 结构化八问
测试有效性:四个新用例都有牙——①reset 到新 world 后释放 in-flight 的 stale 落地,断言 register.base 仍是新 origin(修前必挂);②seed kernel 计数器 42 后断言日志 验证记录:本地定向跑 PR 列出的全部 7 个测试文件 95/95 绿;另单独跑了本次 CI 红掉的 判定:四项修复方向、实现、测试均成立,无回归、无缓存破坏、无配置面变更;唯一红 lane 为在途修复中的已知 Windows flake。rerun 转绿即可合;若 rerun 仍红且挂点相同,按 #3563 合入前的既定处置对待(重跑或等 #3563),不阻塞本 PR 的合入判断。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g [email protected] # this exact build
npm install -g billion-context@master # always the newest merged build
|
Review follow-ups for the v0.1.200 diff (78 commits, #3668). Four independent fixes, each with a regression test; none changes hot-path behavior for a healthy setup.
1. Native self-heal could bind a dead origin after a re-attach (
dsh-native)When a native agent's proxy died,
maybeRetrystarted a fetch for a fresh origin. If the agent was re-activated while that fetch was still in flight (e.g. the user re-attached), the stale origin resolved later and was written into the live register unconditionally — every subsequent tool call went to the dead origin. Same class as #3616; the bootstrap guard already snapshots its generation, but its return value flowed intomaybeRetryunguarded. Fix: snapshotoriginGenbefore the fetch and drop the write if the world moved on. Post-giveUp revival (#983) is still allowed — only the generation check is added.2. Cold-load diagnostics printed a dead counter (
persist)logColdLoadloggedsession.stats.tokensSaved, but #2734 removed the last writer of that field — the line always showed a stale zero (the test hand-set42000to fake it). Now reads the kernel's live counterstate.stats.compressionCount, which starts at 0, increments on every fold, and round-trips with the persisted state.3. Startup credential audit broke on JSONC configs (#3572)
The runtime accepts JSONC config files since #3572, but the boot-time external-summary audit still read the file with strict JSON — a JSONC config logged a bogus parse error and the global summary-credential chain was silently skipped at boot. Now routed through
loadConfigFile(tolerant parser, never throws). The per-route chain was already correct.4. Web editor rejected JSONC configs (#3572, #3488)
The server accepts JSONC since #3572, but the web client strict-parsed the draft text in five places (quick-config hydrate, freshDraft, summary hydrate
read(), save-quick, save-file) — so a config that works at runtime made the quick panel vanish (#3488) and blocked saves. One tolerant parser is defined once in the TS module (strict JSON first, then comment/trailing-comma stripping; string-aware, length-preserving) and inlined into the browser IIFE viatoString()— a single implementation, importable by tests. A genuinely broken draft still fails locally, and the server'sparseBiliConfigstays authoritative on save.Test plan
tests/dsh-native.test.ts— new case pins the superseded-respawn flight; full file 60/60tests/issue3573-cold-load-diagnostics.test.ts— 3/3 on the new countertests/issue3488-credential-status.test.ts— new case: boot audit walks the global chain on a JSONC file; 8/8tests/issue3572-client-draft-parse.test.ts— new: strict-JSON fast path, comments/trailing commas, string literals containing///*//,]survive, malformed text throws, WEB_CLIENT embeds + executes the same parsertests/web-routing.test.ts,tests/issue3572-jsonc-config.test.ts,tests/issue3572-web-jsonc-config.test.ts— all green;tsc --noEmitandnpm run buildclean