Repository navigation
[PR] fix: plugin-fold anchor integrity + Claude watchdog health payload validation - #7231
ranxianglei wants to merge 3 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.10902-pr.7231.1ebacb2This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr7231.tgz
npm install -g packageInstall instructions are refreshed on each push. |
After the first post-fold turn, hideConsumedCompressCalls stubs the re-sent compress call's summary to a 200-char prefix, but stripKernelSummaries only checked range-pair EXISTENCE (not whether the call still carries the full text), so it stripped the in-place anchor too — leaving zero full summary carriers on the wire. Option A (host-side, no kernel change): strip the anchor only when some matching re-sent call's summary is verbatim-equal to the anchor's body. A stubbed (or drifted) call keeps the anchor as the sole full carrier. buildCarrierIndex now tracks per-range summary texts in a single parse pass (ensureRangeSummaries); stripKernelSummaries compares the call's summary against extractAnchorBody(anchor.text) before stripping. Regression tests: tests/issue5866-anchor-integrity.test.ts pins the fresh-call (stripped) and stubbed-call (kept) directions, content-array form, empty-summary, trim normalization, mixed fresh+stub, absent-anchor, and proxy-mode (summary match does not apply) cases. Existing carrier-index tests updated to carry a matching summary field. Closes #5866
(cherry picked from commit 7e69d5b)
a6db332 to
7c74eca
Compare
…ndard Drive-by style fix found in review of #7231: the rewritten function carried a leading space on its declaration line and a 5-space body, off by one from the surrounding code. Whitespace only, no behavior change.
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 No other open [PR] row targets this thread. The only related open PR is #7220 (the original watchdog fix by Afloat) — this PR cherry-picks its commit with 标签: bug, p1, scope/wiring, claude-code, opencode, root-cause(现建) — both fixes are wire/protocol-behavior defects with no kernel change; p1 because #5866 breaks the core compression promise (the full summary is the only record) on the wire for every plugin-lane array-form fold whose summary exceeds 200 chars; claude-code for the watchdog lane, opencode for the #5866 repro lane. Verdict: reviewed, mergeable pending CI green on the new head. Both fixes were verified against source, not just the PR description: #5866 (anchor integrity) — mechanism confirmed byte-for-byte:
#7218 (watchdog) — cherry-pick is faithful: the src/claude-mcp-entry.ts patch is byte-identical to 7e69d5b, the test file byte-identical, authorship (Afloat) preserved, Tests — all green locally on the PR head (targeted runs; full-suite verdict is CI):
顺手修: the rewritten Notes:
8问:
判定: 可合并 — 方向正确(修根因不修症状)、机制对照 kernel 源码逐字节核实、cherry-pick 保真、测试有牙且全绿、审计过的既有行为无回归、不碰 config/persistence/kernel 面。等 db7c615 的 CI 转绿即可合;合并后请 owner 关闭已被吸收的 #7220。 |
Root-cause PR for the plugin-mode aggregation thread (GitHub #7229).
Fixes #5866
Fixes #7218
#5866 — plugin-lane array-form folds end with zero full summaries on the wire
After the first post-fold turn, the kernel's
hideConsumedCompressCallsstubs the re-sent compress call's
summaryto a 200-char prefix, but thehost's
stripKernelSummariesonly checked range-pair EXISTENCE (not whetherthe call still carries the full text), so it stripped the in-place anchor too
— leaving zero full summary carriers on the wire.
Option A (host-side, no kernel change): strip the anchor only when some
matching re-sent call's summary is verbatim-equal to the anchor's body. A
stubbed (or drifted) call keeps the anchor as the sole full carrier.
buildCarrierIndexnow tracks per-range summary texts in a single parsepass (
ensureRangeSummaries).stripKernelSummariescompares the call's summary againstextractAnchorBody(anchor.text)before stripping (plugin blocks with refsonly; proxy-mode id-match and legacy no-ref paths unchanged).
Regression tests:
tests/issue5866-anchor-integrity.test.tspins thefresh-call (stripped) and stubbed-call (kept) directions, content-array form,
empty-summary, trim normalization, mixed fresh+stub, absent-anchor, and
proxy-mode cases. Existing carrier-index tests updated to carry a matching
summary field.
#7218 — Claude native MCP watchdog accepts HTTP-200 HTML / {"ok":false}
Cherry-picked from PR #7220 (commit 7e69d5b, author Afloat) with
-x.The watchdog's default health probe now requires a decoded JSON payload with
ok===trueunder a single 2000ms timeout; recovery chain (ensure→repin→follow), threshold (3), and interval (30s) are untouched.
New suite
tests/claude-watchdog-health-payload.test.ts(15 tests, 11 red onbase).
Behavior change disclosure
range-pair existence → strip. New: range-pair existence AND call summary
verbatim-equals anchor body → strip; otherwise keep. This is the intended
fix (restores the full-summary carrier after the first post-fold turn).
Proxy-mode and legacy no-ref plugin paths are unchanged.
ok!==truepayloads. Old:
res.ok(HTTP 200) → healthy. New: decoded JSONok===true→ healthy. This is the intended fix (prevents the watchdog from skipping
recovery when the proxy returns an HTML error page or
{"ok":false}).