Repository navigation
[PR] fix: v0.1.202 review leftovers — zcode watchdog hot-retry, Responses pck ablation, pck-probe bounds, diagnostics single-read - #3825
Conversation
#3813 item 1: state.failures was reset before await ensure(), so a throwing ensure (transient spawn/EADDRINUSE) cleared the counter and forced ~90s of re-accumulation before the next recovery attempt. The reset now runs only after a successful recovery (self-spawned/lane-owned branch) or after the externally-owned wait log, restoring the v0.1.201 hot-retry behavior and re-aligning with claude-mcp-entry's "(zcode parity)" path.
#3813 item 2: the Responses lane forwarded prompt_cache_key verbatim even after an egress origin+model was A/B-confirmed hostile, re-paying a 400 + probe retry every turn. It now consults pckKeyAbated() like the OpenAI chat lane and drops the key (client-supplied or injected) once ablated.
#3813 item 5: MAX_SESSIONS_TRACKED capped only the display array; the underlying per-pair sessionCounts Map and the pair table grew unbounded under an untrusted tunnel client. Both axes are now capped (per-pair session map evicts lowest-count beyond 32; pair table evicts least-recently-confirmed beyond 64).
#3813 item 6: buildDiagnostics("conflict-banner") set both the storage tail and the conflict banner, each calling candidateLogLines() — two full synchronous readFileSync of the rotated pair (hundreds of MB possible), stalling the event loop. The candidate lines are now fetched once and shared by both tails; output is unchanged.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4547-pr.3825.7de30a1This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3825.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 与 #3813 相关但不同。 本 PR 实现 #3813 清单中的 4 个 host 侧小项(#1 zcode 看门狗、#2 Responses pck 消融记忆、#5 pck-probe 无界增长、#6 diagnostics 双读),并明确把 #3/#4 两个 kernel 项排除在外(等你在 #3813 线程拍板)。按失败签名(zcode watchdog counter / responses prompt_cache_key / pck sessionCounts / candidateLogLines)检索了 open+closed 的 issue 与 PR,没有其他条目覆盖这四项。 标签: bug · zcode · codex · scope/wiring · p3 —— 四个已确认缺陷的修复包,涉及 zcode 与 codex 两条通道,主体改动在客户端接入层/协议接线,全部为非阻塞遗留小项、不影响可用性。 审核进行中:已独立核对四项改动的 diff、既有行为清单与测试有效性,结构化八问结论随后单独给出。 |
The #3813 enrichment test pinned the shared-candidate behavior (identical output, no cross-tail leak) but not the IO property that is the point of item 6: a regression back to per-tail reads would stay green. Count full pair scans in candidateLogLines (test-only accessor + reset) and assert exactly one read for a conflict-banner report (was two), one per further report, and zero for unregistered topics.
(ai: vllm-qwen/qwen3.8-27b) Review complete. I pulled the branch and read all four source diffs against pre-change master, verified each claimed behavior against the actual code paths (watchdog scheduler error handling, claude-lane parity, v0.1.201 tag archaeology, pck record/lookup origin matching, 独立核查(既有行为清单,逐项):
发现一处测试缺口,已直接修掉: #3813 的新 enrichment 测试只钉了共享读的输出属性(无交叉泄漏),没钉读次数——将来谁把双读改回去,测试照样绿。已在 PR 分支补一个标注 commit: 八问:
判定:可合并。 远端 CI 在 head |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.612-master.d4d8acf # this exact build
npm install -g billion-context@master # always the newest merged build
|
What
Host-side fixes for four of the six non-blocking leftovers flagged in the v0.1.202 release review (#3781), tracked in #3813. Each is an independent commit plus a targeted regression test.
Items 3 and 4 are kernel changes (message identity + nudge cadence) that require owner sign-off before implementation per the Kernel Boundary. They are analyzed and presented as a decision request in the #3813 thread, not included here.
Changes (old -> new)
1. zcode watchdog: cool the failure counter only after a completed recovery (
src/zcode/mcp-entry.ts)state.failures = 0ran beforeawait ensure(). A throwing ensure (transient spawn failure / EADDRINUSE) cleared the counter, so the next recovery needed ~90s of re-accumulation (3 x 30s ticks).claude-mcp-entry.ts, whose "(zcode parity)" comment is now accurate again.2. Responses lane honors the #2645 prompt_cache_key ablation memory (
src/server/prepare-responses.ts)prompt_cache_keyverbatim even after an egress origin+model was A/B-confirmed hostile, re-paying a 400 + probe retry every turn (the client still saw a final 200).pckKeyAbated()like the OpenAI chat lane and drops the key (client-supplied or injected) once ablated.3. Bound the pck-probe ablation maps (
src/pck-probe.ts)MAX_SESSIONS_TRACKED=8capped only the display array; the underlying per-pairsessionCountsMap and the pair table grew unbounded under an untrusted tunnel client._pckProbeSessionCountForTestexposes the previously-unobservable map size.4. Diagnostics reads the rotated log pair once per report (
src/web/diagnostics.ts)conflict-bannerrequest set both the storage tail and the conflict banner; each calledcandidateLogLines(), doing two full synchronousreadFileSyncof the rotated pair (hundreds of MB possible) and stalling the event loop.Tests
Targeted suites (run locally, green):
tests/zcode-mcp-entry.test.ts— 9 pass (incl. new: a throwing ensure leaves the counter hot)tests/issue3813-responses-pck-ablation.test.ts— new, 2 pass (positive drop + negative forward)tests/issue2645-pck-probe.test.ts— 8 pass (incl. new: pair-flood + session-flood bounds)tests/web-diagnostics-enrichment.test.ts— 5 pass (incl. new: single-read, no cross-leak between tails)Full-suite verdict comes from CI on the pushed head.
tsc --noEmitis clean project-wide.Not in this PR
kernel/src/wire/*) and item 4 (nudge low-water ratchet inkernel/src/compress.ts) are kernel changes requiring owner approval plus a kernel version bump. The analysis and options are in the [review] v0.1.202 release-review leftovers: zcode watchdog recovery latency, responses lane ignores pck ablation memory, URL-image id churn, nudge low-water ratchet | 发版审核遗留小项(不阻塞) #3813 thread.Refs #3813