Skip to content

[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

Open
ranxianglei wants to merge 3 commits into
masterfrom
fix-6965-stub-carrier

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

这是什么

kernel/src/hide-consumed.ts 里有一对互相打架的机制:

两个机制叠加的后果:裸名调用的参数被压成 200 字 stub,而它本该去重的锚点又恰好被 #4311 跳过了——这个块的 summary 全文在出网报文里哪儿都不在(模型侧只有 200 字残片,完整文本只能靠 decompress 取回)。只影响 JSON 数组形式的参数;plain-string 参数(现行 pi 会话用的形式)从不经过 stub,所以线上 pi 会话一直没事——这是个潜伏缺陷,#6965 追查 01a1dfae 会话时定位到。

改法

把 stub 的作用域收紧到「旁边真的还有锚点渲染」的场合:

#2749 防「模型抄 stub 重新折叠」的守卫不受影响:它只收「199/200 字符且以 … 结尾」的结构带,全文 summary 不可能误触发;其测试改为通过 orphan 发射的 stub 覆盖该守卫。

测试

  • kernel 套件:1641/1641 全绿(npm --prefix kernel test),含新增回归:裸名活动调用保留全文、外部命名载体仍 stub、tag 前缀 / stringified-content 两种参数形态;
  • host 侧 tests/stub-resubmission-guard.test.ts([严重]t2压缩被截断为200字 #2749)按新行为重写后 5/5 绿;verif-subset-guard 2/2 绿(hide-consumed.ts 在 verif 守护清单内);
  • 本地 bili 全量套件有 26 处失败,全部是 15s 超时的 attach/apply 模式用例(本机多会话高负载,与本改动无关的既有噪音基线);以 CI 为准。

kernel-change: re-scoped hide-consumed summary stubbing (#6965)

owner 已在 issue #6965 线程内预批(「内核可以改」);机械性缺陷豁免路径:附复现回归测试 + 本声明 + 线程内报告。

#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).
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: fix-6965-stub-carrier (df4acb4)

Latest build — install this exact version

npm install -g billion-context@0.0.11010-pr.6990.f9425d6

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
df4acb4 billion-context@0.0.11010-pr.6990.f9425d6 build
f831adf billion-context@0.0.10537-pr.6990.7dc3d0c build
3deac0c billion-context@0.0.10528-pr.6990.4a3832b build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr6990.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title kernel: compress 调用参数不再把自己的 summary stub 掉(#4311 已跳过锚点渲染,stub 会让 summary 全文丢失) [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 全文丢失) Nov 17, 2026

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

评审(自审,按默认流程直发):approve,无需要追加的 fix commit。

逐项核对过的点:

  1. fate 覆盖完整性:stub = toolName !== COMPRESS_TOOL_NAME || fate === "orphan" 看似漏了「inactive 块的裸名调用」(块存在、锚点不渲染,却保留全文参数会白花 token)。核对 hideConsumedCompressCalls 的 hide 逻辑:fate === "inactive" 的调用连同结果整对隐藏(hideConsumed 主循环),根本到不了 stub 分支——可见的 compress 调用只有 active 与(未清扫的)orphan 两种 fate,两个分支恰好覆盖全部。不是漏网,是结构上不存在该路径。
  2. #4311 与 stub 的互锁方向:prune.ts 的锚点跳过条件是按 id(block.compressCallId ∈ visibleCompressCallIds,只收裸名调用 id)。外部命名载体的宿主 id 永远不进这个集合 → 锚点必渲染 → stub 去重前提成立 → 保留 stub 正确;裸名活动调用 → 锚点必跳过 → 参数是唯一载体 → 保留全文正确。两机制的方向在新作用域下严格互补,无第三态。
  3. 字节稳定性:rewriteCompressText 在「未过滤任何 entry 且不需要 stub」时提前返回 null,保持原文字节不动(不动 provider 已缓存前缀);需要 stub 时照常重序列化。
  4. #2749 守卫:visibleSummaryStubs(src/stream.ts:899-929)只收 199/200 字符且以 U+2026 结尾 的结构带且仅限裸名 lane——全文 summary 不可能误触发;守卫测试改经 orphan 发射的 stub 覆盖,5/5 绿。
  5. 测试面:kernel 1641/1641、#2749 守卫 5/5、verif-subset-guard 2/2、typecheck 干净。本地 bili 全量套件的失败全部是 15s 超时的 attach/apply 用例(本机多会话高负载噪音,与本改动无交集),以 CI 为准。
  6. 版本/声明:kernel 0.0.198 → 0.0.199,commit 消息带 kernel-change: 声明,owner 预批在 #6965 线程内。

合并留给人。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

查重: 不重复。本线程(GitHub PR #6990,分支 fix-6965-stub-carrier,commit 3deac0c)是 issue #6965 中 Defect B(JSON 数组参数 summary 双重丢失)的唯一修复 PR;镜像中该主题只有一个 open [PR] 行(#6991),无并列第二 PR。

独立复核(逐行读了 diff,非照抄 #6965 线程与 owner 自审结论):

八问:

  1. 是什么问题: JSON 数组形式的 compress 调用参数,其 summary 被 feat: codex compact family — combined #322/#323/#324/#325/#317/#319 + UA unification #336 压成 200 字 stub,而 There are two copies of the summary sent to the model: the block's acp_summary rendering and the compress call parameter | 发给模型的摘要有两份:块的 acp_summary 渲染 + compress 调用参数各存一份 — 组合快照时,调用在场就不要再渲染 #4311 又在该「裸名发起调用」可见时跳过该块的锚点渲染——叠加后果是这个块的 summary 全文在出网报文里哪儿都不在(模型侧只剩 200 字残片,完整文本只能靠 decompress 取回)。
  2. 什么原因导致的: feat: codex compact family — combined #322/#323/#324/#325/#317/#319 + UA unification #336(stub 去重)与 There are two copies of the summary sent to the model: the block's acp_summary rendering and the compress call parameter | 发给模型的摘要有两份:块的 acp_summary 渲染 + compress 调用参数各存一份 — 组合快照时,调用在场就不要再渲染 #4311(锚点跳过)作用域未对齐——feat: codex compact family — combined #322/#323/#324/#325/#317/#319 + UA unification #336 假设「旁边一定有锚点渲染」来做去重,但 There are two copies of the summary sent to the model: the block's acp_summary rendering and the compress call parameter | 发给模型的摘要有两份:块的 acp_summary 渲染 + compress 调用参数各存一份 — 组合快照时,调用在场就不要再渲染 #4311 在裸名调用可见时恰恰不渲染锚点,于是 stub 删掉了 summary 唯一的出网载体。
  3. 影响范围与严重程度: 只影响 JSON 数组形式的参数;plain-string 参数(现行 pi 会话用的形式)从不经过 stub,所以线上 pi 会话一直没事。属潜伏缺陷(pi inline: After compression, requests sent to the model intermittently lose all summary blocks — the model loses the co | pi inline:压缩后发给模型的请求间歇性丢失全部摘要块——模型丢失已压缩历史,视图在"有摘要/无摘要"两态间振荡(伴 m00001 头部折不掉、nudge 范围横跨已折叠区间) #6965 追查 01a1dfae 会话时定位),特定条件(JSON 数组参数 + 裸名调用可见)下 summary 全文丢失。
  4. 怎么修复的: 把 stub 作用域收紧到「旁边真的还有锚点渲染」的场合——const stub = toolName !== COMPRESS_TOOL_NAME || fate === "orphan"。我独立核对了 Fate 三分支 × 裸名/外部命名的全部组合:inactive 调用在主循环更早的 hide 分支整对隐藏、到不了 stub 逻辑;可见调用只有 active(裸名→保留全文 / 外部命名→stub)与 orphan(stub)两种,覆盖完整。
  5. 是否有回归问题: 无。[严重]t2压缩被截断为200字 #2749 防「模型抄 stub 重新折叠」守卫不受影响——它只收「199/200 字符且以 … 结尾」的结构带,全文 summary 不可能误触发;host 测试(tests/stub-resubmission-guard.test.ts)已改为经 orphan 发射的 stub 覆盖。kernel 0.0.198→0.0.199 bump 合规;两个 package-lock 只动版本号,无连带变更。
  6. 是否破坏缓存: 不破坏,反而改善。裸名活动调用现在保留全文参数(if (kept.length === content.length && !stub) return null 避免无谓 re-serialize),消除了「归一化 provider 已缓存字节」的隐患。
  7. 是否改了设计方向: 否。是既有 feat: codex compact family — combined #322/#323/#324/#325/#317/#319 + UA unification #336 stub 机制的作用域收紧,feat: codex compact family — combined #322/#323/#324/#325/#317/#319 + UA unification #336 去重目标(外部命名载体/orphan)仍成立,不是新方向。
  8. 是否引入了新的配置: 否。

kernel 门禁: kernel-change: 声明齐备;owner 已在 #6965 线程预批(「内核可以改」);走机械性缺陷豁免路径(复现回归测试 + 声明 + 线程内报告)。合并留给人(kernel 变更 human-only 档,owner 已自审 approve)。

CI 现状(刚查镜像缓存): e2e 各车道全绿;主 CI 还有 13 个 check 在跑(0 红),属排队积压,跑完我再补最终红绿。

顺带发现(不属本 PR 范围,owner 已说单独开 issue): 52.4B thinking 显示 bug(formatK 无 B 后缀)——本 PR 不碰,留 owner 单独立项。

判定: 代码正确、测试覆盖三 case、版本 bump 合规、kernel 门禁齐备、owner 已自审 approve——等主 CI 绿 + 人工合并即可收工。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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 — #2929: nudge + proxy-tool-round fold keeps re-request/next-turn byte-stable (tests/issue2929-codex-fold-double-miss.test.ts).

Root cause (NOT this PR's change): the 2929 probe hardcodes request-index anchors (PROXY_TOOL_AT=6 / FOLD_AT=7) calibrated for the #4521 nudge schedule {4,6,8,9}. Master commit 4ccccab15f (#6928) removed the #4521 armed-but-silent [ACP status: …] refresh line, which shifted the nudge schedule so the nudge no longer lands on request 6 → the probe's scenario-materialization assertion fails. I verified the test fails identically on master (built the kernel in a master worktree), so this is an inherited master red, not caused by the PR's kernel change.

Fix (per the CI-failure coordination policy): inherited master red → merged origin/ci-fixes into the PR branch. ci-fixes already carries the sentinel's root-cause fix (7247410976): make the 2929 probe schedule-independent (arm the fold on the first nudge-carrying request with ≥11 refs instead of hardcoded indices) + pin compress.messageTimestamps:false for a hermetic wire shape. The merge is clean — it only touches tests/issue2929-codex-fold-double-miss.test.ts (+1 docs line), with no overlap against the PR's kernel changes. Verified locally: the test now passes both with and without the CI preload pin (BILI_MESSAGE_TIMESTAMPS="0").

Pushed: final head f831adfe9a (the ci-fixes merge) to fix-6965-stub-carrier — this is the branch's one full CI pass.


结构化八问

  1. 是什么问题:PR [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 的 CI 红了 3 个 test 分片(ubuntu-24 / ubuntu-22 / windows-22),全部挂在同一个测试 #2929: nudge + proxy-tool-round fold keeps re-request/next-turn byte-stable。
  2. 什么原因导致的:不是本 PR 的改动引起。2929 探针测试硬编码了请求下标锚点(PROXY_TOOL_AT=6/FOLD_AT=7),是按 Compression conflict banner (bili v0.1.205, node v24.19.0, win32-x64) #4521 的 nudge 调度 {4,6,8,9} 标定的;master 提交 4ccccab15f(Per-turn '[ACP status: …]' line keeps ordering the model to fold leftover small ranges right after a big fold — the opposite of what the compress receipt says #6928)删掉了 Compression conflict banner (bili v0.1.205, node v24.19.0, win32-x64) #4521 那行 armed-but-silent 的 [ACP status: …] 刷新行,导致 nudge 调度偏移、nudge 不再落在第 6 个请求上,探针的场景物化断言失败。这是继承的 master 红(已在 master worktree 验证:该测试在 master 上同样失败),与本 PR 的 kernel 改动无关。
  3. 影响范围与严重程度:只影响 CI 里这一个探针测试(3 个分片各挂一次),无用户可见影响——是测试标定问题,不是功能 bug。PR 真正的 kernel 改动(bare-name compress 调用保留完整 summary 参数)不受影响,原本就是绿的。
  4. 怎么修复的:按 CI 失败协调政策,这是继承的 master 红 → 把 origin/ci-fixes merge 进 PR 分支。ci-fixes 已带哨兵的根因修复(7247410976):让 2929 探针与调度解耦(在第一个带 nudge 且 ≥11 个 ref 的请求上触发 fold,而非硬编码下标)+ 钉住 compress.messageTimestamps:false 保证 wire shape 可复现。本地已验证:该测试在带与不带 CI preload pin(BILI_MESSAGE_TIMESTAMPS="0")下都通过。
  5. 是否有回归问题:无。merge 只动了 tests/issue2929-codex-fold-double-miss.test.ts(纯测试)+ reference/architecture.md(文档 1 行),未触碰任何功能代码;PR 的 kernel 改动及其测试未被改动。
  6. 是否破坏缓存:不涉及。未触碰任何缓存/重试/增量游标/去重键逻辑。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。测试里钉住的 compress.messageTimestamps:false 是测试本地配置(保证 hermetic),不是新的用户配置面。

收工判定:CI 红已清(继承的 master 红,经 merge ci-fixes 解决),最终 head f831adfe9a 已推送,待 CI 全绿。PR 的 kernel 改动本身无问题。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

CI 状态更新(逐 job 拉了日志核实):

主 CI 之前红了,但两处失败都是 master 继承性红,与本 PR 改动无关:

  1. architecture-docs:reference/architecture.md 缺 src/responses-system-sections.ts([Bug] Inconsistent system prompt separator in Responses internal re-request breaks cache prefix | [Bug] Responses 内部重请求的系统提示分隔符不一致,破坏缓存前缀 #6922 落 master 后漏登记)。master 上 grep 0 命中,ci-fixes 上 grep 1 命中——修复在 ci-fixes,不在 master。本 PR 分支与 master 齐平(0 behind),所以继承了这个红。
  2. test 三个 shard(ubuntu 22/3、ubuntu 24/3、windows 22/4)同一处:#2929: nudge + proxy-tool-round fold keeps re-request/next-turn byte-stable —— scenario miss: no ephemeral nudge in the pre-fold request (inputs[6]) — probe does not cover the production trigger。这是 nudge probe 场景没触发,不是断言挂。本 PR 没碰 tests/issue2929-codex-fold-double-miss.test.ts(diff 为空),也不引用 hide-consumed/stub,所以与本改动无关。

处置(按 CI 失败协调 policy):

  • 本 PR 不重复修 master 级失败。
  • 两处红均已在 ci-fixes 收敛(architecture-docs 补登记 + codex 命中率问题分析 #2929 probe 校准)。
  • PR 分支已 merge origin/ci-fixes(新 head f831adfe9a),CI 重跑中(当前 7 绿 / 9 skip / 16 queued / 1 in-progress / 0 红)。

等 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.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Resolved the merge conflict on this PR.

What was blocking: the PR conflicted with its base (master). Master had moved forward (kernel 0.0.198 → 0.0.200) since the PR branched, and the PR carried its own kernel bump (0.0.198 → 0.0.199 for the hide-consumed.ts change) → the kernel version fields collided.

The conflict (3 files, all the same field): kernel/package.json, kernel/package-lock.json, package-lock.json — each had the acp-kernel version as 0.0.199 (PR) vs 0.0.200 (master). No code conflicts — kernel/src and src/ merged cleanly (master never touched hide-consumed.ts).

Resolution: merged origin/master into the PR branch and resolved the version collision to 0.0.201 — master's 0.0.200 + 1, so the PR's kernel/src change keeps its own bump above master (required by the Kernel Boundary version rule: a kernel/src change MUST bump the version; keeping master's 0.0.200 would fail the version-guard since the PR's hide-consumed.ts change is a real kernel edit). Only the version/lockfile fields needed a decision; all code merged cleanly.

Verified locally: kernel builds; hide-consumed-stub (the PR's kernel test, 6/6), the 2929 fold test, and stub-resubmission-guard (5/5) all green. The ci-fixes 2929 schedule-independent fix is already an ancestor of master, so it's preserved.

Pushed: final head df4acb43384 (merge commit, parents = PR head f831adfe9a + master 6453feeeb8) to fix-6965-stub-carrier. No [ework:ci-held] marker — this is the branch's one full CI pass.

Live merge-state note: the mirror check cache is stale (last poll 2026-11-17, still showing the pre-push sha f831adfe9a), so I could not confirm the live GitHub merge state in this run. The merge itself is definitive locally — I performed it, resolved all 3 conflicts, and verified no markers remain.


结构化八问

  1. 是什么问题:PR [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 与 base 分支(master)产生合并冲突,merge state 变 dirty,CI 被阻塞。
  2. 什么原因导致的:master 在 PR 分叉后前进了(kernel 0.0.198 → 0.0.200,含 [Bug][anthropic][opencode] 0.1.216: After degenerate fold, messages[2] system is dispatched as-is (bypassing the final h | [Bug][anthropic][opencode] 0.1.216: degenerate fold 后 messages[2] system 原样出站(越过最终 healAnthropicSystemPositions)→ 400 must precede … #7270 directive-only 改动 + 与 [PR] compress.reasoning.tail: drop reasoning of any closed round in the protected window (#7144 follow-up) #7252 的 0.0.199 碰撞解决),而 PR 自己也带了 kernel 0.0.198 → 0.0.199 的 bump(hide-consumed.ts 改动)→ 两边 kernel 版本号字段撞车。仅版本号/lockfile 冲突,代码无冲突(master 没碰 hide-consumed.ts)。
  3. 影响范围与严重程度:仅阻塞本 PR 的合并,无用户面影响;是版本字段碰撞,不是代码逻辑冲突。
  4. 怎么修复的:把 origin/master merge 进 PR 分支,版本碰撞解决为 0.0.201(master 的 0.0.200 + 1),让 PR 的 kernel/src 改动保留自己在 master 之上的 bump(Kernel Boundary 版本规则要求:kernel/src 改动必须 bump 版本;若沿用 master 的 0.0.200 会挂 version-guard)。代码全部干净合并,只有版本/lockfile 字段需要裁决。本地验证:kernel 可构建,hide-consumed-stub(6/6)、2929 fold 测试、stub-resubmission-guard(5/5)全绿。
  5. 是否有回归问题:无。merge 只是把 master 的前进变更并入 + 解决版本字段;PR 的 kernel 改动(hide-consumed.ts)未被改动,其测试仍绿;2929 的 schedule-independent 修复已在 master 上(是其祖先),保留不变。
  6. 是否破坏缓存:不涉及。未触碰任何缓存/重试/游标/去重逻辑。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

收工判定:合并冲突已解决(版本碰撞 → 0.0.201),最终 head df4acb43384 已推送,待 CI 全绿。注:镜像 check 缓存陈旧(2026-11-17 后未刷新),本轮无法确认 GitHub 实时 merge state,但本地 merge 已确定性完成。

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant