Repository navigation
[PR] fix(kernel): stub plain-text line-form compress calls in consumed-call cleanup (#3975) - #4032
ranxianglei wants to merge 3 commits into
Conversation
adc4c38 to
b0c09ae
Compare
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4817-pr.4032.1512ad8This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr4032.tgz
npm install -g packageInstall instructions are refreshed on each push. |
b0c09ae to
cedd2a4
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 本 PR 是 #3975 的专属修复 PR(Closes #3975)。相邻条目核对:#3785(line-form 双重转义换行打捞,已合)改的是解析入口的容错,不是 consumed-call 清理;#2970/#2977(MCP compress 路由进清理层)、#3769/#3784(orphan 清扫门控)是本 PR 依赖的既有机制而非平行修复;#4311(摘要双份保留,已关)与本 PR 同症状家族但指向的是载体去重边界,PR 已按该边界刻意不扩大 carrier 索引。无并列的同机制在途 PR。 标签:pr + bug + scope/kernel + p2(缺陷类;根因与改动都在 kernel 的 consumed-call 清理面;能用但有冗余驻留、有绕行——p2;MCP shim 为多宿主共用面,不打具体客户端标签)。 开始独立审核(不照抄 #3975 线程结论):拉分支通读 diff、清点触碰路径的既有行为、本地定向跑新增测试与相关套件、核对 CI。另注意到 PR head 相对当前 master 显示 merge conflict(master 已推进约 3 天),审核中一并处理 rebase。结论随后按八问回复。 |
…anup (#3975) parseCallText only understood object-array content (and stringified JSON arrays), so a plain-text line-form content string — which the compress tool itself accepts via parseLineEntry — resolved to no quoted ranges. Such calls mis-resolved as orphans and rode the keep-last-two orphan window UNSTUBBED, retaining their full summary text forever alongside the kernel acp_summary. Reuse the tool's own acceptance ladder: export parseLineContent from parse-compress-input.ts (stripJsonWrapperResidue -> splitLineEntries -> parseLineEntry) so hide-consumed resolves ranges from exactly what the tool accepts instead of a second hand-rolled reader. Line-form calls now resolve active/inactive by range like object-array calls, get their long summaries stubbed to 200 chars with headers re-emitted verbatim, and free their orphan window slots for genuinely failed calls. Unparsable/garbage strings stay byte-identical (no refs claimed, no rewrite). kernel/package.json 0.0.147 -> 0.0.148 (CI kernel-guard).
Host-level regression for the issue's expectations 2-3: after hideConsumedCompressCalls + stripKernelSummaries, a plain-text mcp__bili__compress call ends stubbed while its acp_summary anchor stays byte-complete as the sole full carrier — guarding against future buildCarrierIndex over-widening that would strip the anchor off stubbed args. Parity pin: object-array end state unchanged.
cedd2a4 to
40c9d06
Compare
(ai: vllm-qwen/qwen3.8-27b) PR #4032 独立复审结论(对最新 master 重读 diff 与行为,不复述 #3975 线程结论)。 已执行的动作
八问
已知残留(不阻塞,已在 #3975 记为 checklist 项):parser 仍接受的两种 legacy flat 形状( 判定:代码闭环、测试有牙(10+2 kernel / 2 host,含负向门)、冲突已解、本地定向证据齐。等 CI 全局门转绿后建议合并——kernel 变更属 human-only review 档,请人工合并:#4032 。CI 结果出来我再补一条确认。 |
Closes #3975
kernel-change: the consumed-call cleanup (
kernel/src/hide-consumed.ts) cannot parse the plain-text line-formcontentthat the compress tool itself accepts (parseLineEntry); the host side cannot fix this without duplicating the line-form parser in a second location (format-drift risk — the #3780 precedent already locates the shared home for this decode in the kernel). Issue #3975 is the dedicated issue naming the kernel root cause.Rebased onto current master (incl. #3769, which replaced the old keep-last-two orphan rotation with the fold-gated sweep); tests adapted to the current semantics, end-state guarantees unchanged.
What breaks today
parseCallTextunderstood object-array content and stringified JSON arrays only. A plain-text line-form content string (first linem00100–m00120 topic, remaining lines the summary) resolved to no quoted ranges, so such calls mis-resolved as orphans: on quiet turns they stayed visible unstubbbed — retaining their full summary text forever alongside the kernelacp_summary— and on fold turns they were swept as failure residue although they ARE the folded block's summary carrier (#1567). Measured in the reporter's snapshot: 2 of 15mcp__bili__compresscalls unsimplified (~2.68K tokens args, ~2.54K redundant full-text overlap across 10 active blocks).The same mechanism also kept bare-name proxy-lane line-form calls at full length forever (id-matched fate always keeps; the rewrite returned null pre-fix).
Fix
Reuse the tool's own acceptance ladder instead of a second reader:
parse-compress-input.ts: new exportedparseLineContent(content)—stripJsonWrapperResidue → splitLineEntries → parseLineEntry, i.e. exactly what the compress tool accepts whencontentis not a JSON array. Unparsable entries keepsource/headeronly and never claim a range.hide-consumed.ts: string content whose inner JSON value is not an array (or fails to parse) flows throughparseLineContent; quoted-range keys use the normalized refs (aligning with how line-form specs store block refs); rewrite/compact rebuild the line form with headers verbatim and long summaries stubbed to 200 chars, re-emitting the full args object with the string shape preserved (fix: persistent overlay homes for pi/omp/hermes launchers (session history loss) #230 convention). Garbage/refless strings stay byte-identical.Line-form calls now resolve active/inactive by range exactly like object-array calls and get stubbed identically; on fold turns they are fate=active and therefore exempt from the #3769 sweep, while true orphans are still swept at/after the fold start.
Behavior change (old → new)
acp_summaryretention for these blocksObject-array, stringified-array, and garbage paths are regression-pinned unchanged.
Config surface
None — no config/env/CLI changes.
Tests
kernel/tests/issue3975-hide-consumed-lineform.test.ts(new, 9): normalization (m100→m00100, b2/b5, topic), refless-garbage verbatim, MCP synthetic-id plain-text carrier stubbed as STRING, fold-sweep exemption for a live-range plain-text carrier while a true orphan is swept ([Bug] MCP failed compression record rotation prematurely rewrites the history prefix, triggering expensive cache recompu | [Bug] MCP 失败压缩记录轮换提前改写历史前缀,触发大额缓存重算 #3769/plugin mode: in-place acp_summary never stripped when the client's own compress pair rides inbound — double summary carrier on every post-fold turn #1567), partial-range invalidation (live kept+stubbed / dead dropped), all-dead hidden, quiet-turn failed-fold orphans visible but stubbed, bare-name id-matched lane, stringified-array shape+stub regression (fix: persistent overlay homes for pi/omp/hermes launchers (session history loss) #230).tests/issue3975-mcp-lineform-endstate.test.ts(new, host level): issue expectations 2–3 pinned end-to-end — afterhideConsumedCompressCalls+stripKernelSummaries, the plain-text call ends stubbed while itsacp_summary_b0anchor stays byte-complete; object-array parity pin.