Repository navigation
[PR] kernel: compress call parameters no longer stub out their own summary (#4311 already skips anchor rendering; stubbing wo | kernel: compress 调用参数不再把自己的 summary stub 掉(#4311 已跳过锚点渲染,stub 会让 summary 全文丢失) - #6990
Conversation
#4311 skips the acp_summary anchor render exactly while the originating bare-name call is visible in the view — so stubbing that call's JSON-array args to 200 chars (#336) no longer deduplicates against anything: the summary's full text then exists nowhere on the wire (plain-string args were never affected; only the JSON-array shape lost it). While the call is visible, its args are that block's SOLE full-summary carrier. Re-scope the stub to where a rendered anchor actually rides beside the call: foreign-name carriers (host call id absent from the view, so the anchor renders and the #336 dedup holds) and orphan calls (no block, no anchor). Bare-name active calls keep full args; the #4311 skip means no duplication, so this costs no extra tokens versus the anchor era. The #2749 stub-resubmission guard is unaffected: it harvests the structural band (199/200 chars + U+2026), which a full summary can never match. Its tests now exercise the guard through orphan-emitted stubs. kernel-change: re-scoped hide-consumed summary stubbing (#6965); owner pre-approval in-thread, mechanical-bug exemption (reproducing regression tests added).
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.11010-pr.6990.f9425d6This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6990.tgz
npm install -g packageInstall instructions are refreshed on each push. |
ranxianglei
left a comment
There was a problem hiding this comment.
评审(自审,按默认流程直发):approve,无需要追加的 fix commit。
逐项核对过的点:
- fate 覆盖完整性:
stub = toolName !== COMPRESS_TOOL_NAME || fate === "orphan"看似漏了「inactive 块的裸名调用」(块存在、锚点不渲染,却保留全文参数会白花 token)。核对hideConsumedCompressCalls的 hide 逻辑:fate === "inactive"的调用连同结果整对隐藏(hideConsumed 主循环),根本到不了 stub 分支——可见的 compress 调用只有 active 与(未清扫的)orphan 两种 fate,两个分支恰好覆盖全部。不是漏网,是结构上不存在该路径。 - #4311 与 stub 的互锁方向:prune.ts 的锚点跳过条件是按 id(
block.compressCallId ∈ visibleCompressCallIds,只收裸名调用 id)。外部命名载体的宿主 id 永远不进这个集合 → 锚点必渲染 → stub 去重前提成立 → 保留 stub 正确;裸名活动调用 → 锚点必跳过 → 参数是唯一载体 → 保留全文正确。两机制的方向在新作用域下严格互补,无第三态。 - 字节稳定性:
rewriteCompressText在「未过滤任何 entry 且不需要 stub」时提前返回 null,保持原文字节不动(不动 provider 已缓存前缀);需要 stub 时照常重序列化。 - #2749 守卫:
visibleSummaryStubs(src/stream.ts:899-929)只收199/200 字符且以 U+2026 结尾的结构带且仅限裸名 lane——全文 summary 不可能误触发;守卫测试改经 orphan 发射的 stub 覆盖,5/5 绿。 - 测试面:kernel 1641/1641、#2749 守卫 5/5、verif-subset-guard 2/2、typecheck 干净。本地 bili 全量套件的失败全部是 15s 超时的 attach/apply 用例(本机多会话高负载噪音,与本改动无交集),以 CI 为准。
- 版本/声明:kernel 0.0.198 → 0.0.199,commit 消息带
kernel-change:声明,owner 预批在 #6965 线程内。
合并留给人。
查重: 不重复。本线程(GitHub PR #6990,分支 独立复核(逐行读了 diff,非照抄 #6965 线程与 owner 自审结论): 八问:
kernel 门禁: CI 现状(刚查镜像缓存): e2e 各车道全绿;主 CI 还有 13 个 check 在跑(0 红),属排队积压,跑完我再补最终红绿。 顺带发现(不属本 PR 范围,owner 已说单独开 issue): 判定: 代码正确、测试覆盖三 case、版本 bump 合规、kernel 门禁齐备、owner 已自审 approve——等主 CI 绿 + 人工合并即可收工。 |
Cleared the red CI on this PR. Summary: What was red: 3 test shards (ubuntu-24, ubuntu-22, windows-22) all failed the same single test — Root cause (NOT this PR's change): the 2929 probe hardcodes request-index anchors ( Fix (per the CI-failure coordination policy): inherited master red → merged Pushed: final head 结构化八问
收工判定:CI 红已清(继承的 master 红,经 merge |
CI 状态更新(逐 job 拉了日志核实): 主 CI 之前红了,但两处失败都是 master 继承性红,与本 PR 改动无关:
处置(按 CI 失败协调 policy):
等 CI 全绿后,本 PR 即可人工合并。 |
Resolve the acp-kernel version collision: master bumped to 0.0.200 (its own kernel changes + the #7252 0.0.199 collision), this PR carried 0.0.199 (the hide-consumed.ts change). Resolved to 0.0.201 so the PR's kernel/src change keeps its own bump above master. Only the version/lockfile fields conflicted; all code merged cleanly. Verified locally: kernel builds, hide-consumed-stub / 2929 / stub-resubmission-guard tests green.
Resolved the merge conflict on this PR. What was blocking: the PR conflicted with its base ( The conflict (3 files, all the same field): Resolution: merged Verified locally: kernel builds; Pushed: final head Live merge-state note: the mirror check cache is stale (last poll 2026-11-17, still showing the pre-push sha 结构化八问
收工判定:合并冲突已解决(版本碰撞 → |
这是什么
kernel/src/hide-consumed.ts里有一对互相打架的机制:acp_summary锚点去重,省 ~22K token);两个机制叠加的后果:裸名调用的参数被压成 200 字 stub,而它本该去重的锚点又恰好被 #4311 跳过了——这个块的 summary 全文在出网报文里哪儿都不在(模型侧只有 200 字残片,完整文本只能靠 decompress 取回)。只影响 JSON 数组形式的参数;plain-string 参数(现行 pi 会话用的形式)从不经过 stub,所以线上 pi 会话一直没事——这是个潜伏缺陷,#6965 追查 01a1dfae 会话时定位到。
改法
把 stub 的作用域收紧到「旁边真的还有锚点渲染」的场合:
#2749 防「模型抄 stub 重新折叠」的守卫不受影响:它只收「199/200 字符且以 … 结尾」的结构带,全文 summary 不可能误触发;其测试改为通过 orphan 发射的 stub 覆盖该守卫。
测试
npm --prefix kernel test),含新增回归:裸名活动调用保留全文、外部命名载体仍 stub、tag 前缀 / stringified-content 两种参数形态;tests/stub-resubmission-guard.test.ts([严重]t2压缩被截断为200字 #2749)按新行为重写后 5/5 绿;verif-subset-guard2/2 绿(hide-consumed.ts 在 verif 守护清单内);kernel-change: re-scoped hide-consumed summary stubbing (#6965)
owner 已在 issue #6965 线程内预批(「内核可以改」);机械性缺陷豁免路径:附复现回归测试 + 本声明 + 线程内报告。