Repository navigation
[PR] fix: in external-summary mode, #2749 guard scan no longer falsely reports rejected logs for historical compress calls (# | fix: external-summary 模式下 #2749 守卫扫描不再对历史 compress 调用误报 rejected 日志 (#5161) - #5227
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.7413-pr.5227.ea76e2fThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5227.tgz
npm install -g packageInstall instructions are refreshed on each push. |
… under the global legacy test baseline its sidecar never opens and the index reconstruction gate can never pass
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 open+closed 均无覆盖此「守卫扫描重复解析打误报」的条目;与 #2749 同代码路径但缺陷不同——#2749 是守卫机制本身(拦 stub 重提交),#5161 是该守卫每次 fold 重解析历史调用时把「external 模式合法的无 summary 调用」当畸形打 warn。 标签: 审核方式: 拉到 PR 分支(pr-5227,head 结构化八问
测试有效性(#3617 双向门禁): 3 测都有牙——T1(issue 验收:N=3 可见无 summary + 1 次新 fold → 零 一处需你知晓(非阻塞): head 里多了一个 判定: 方向对、修法最小且行为保持、测试有牙、已与最新 master 同步、未发现回归。建议 CI 全绿后可合(我不合并,PR 合并仅人工)。 |
(ai: vllm-qwen/qwen3.8-27b) 收工小结(完整八问审核见上一条):PR #5227(修 #5161 external-summary 守卫扫描日志噪音)已审完,可合。
CI:当前 0 failed / 14 pending,test 矩阵仍在排队(gate×2 + pi-subagents-guard 已绿)。等 test 全绿即可合;我不合并(PR 合并仅人工)。若 test 红了我会定向排查是否本 PR 自身代码问题。 |
…t/format conflicts)
|
(ai: sglang-gpu0/qwen3.8-27b) Merged current master into this branch (6ae12c4) — the only conflicts were two cosmetic hunks in tests/plugin-fork.test.ts (a comment wording + an if/else formatting difference around the inherited #5140 cold-restore test), resolved keeping this branch's phrasing. No content was changed by the merge itself. Targeted local runs on the merged head are green: tests/issue5161-compress-scan-log-noise.test.ts 3/3 and tests/plugin-fork.test.ts 56/56 (the inherited #5140 regression from master). Re-run is queued behind the repo's CI backlog; the branch should now report clean once it finishes. |
(ai: vllm-qwen/qwen3.8-27b) merge-guard 复核完成 — 对合并后 head( 逐项核验结果:
判定:无需任何进一步动作。 等这轮 CI 出结果:全绿即可合(PR 合并仅人工);若再红,按 CI 总控流程先看 #4599 判继承性还是本 PR 自身问题。 |
ranxianglei
left a comment
There was a problem hiding this comment.
审查完成(本地分支 @6ae12c49,已核对 src 全量 diff + 调用点面 + 回归批)。结论:代码通过,无阻塞项;CI 全绿即可人工合并。
逐项核验:
- 修法对症且最小(src/compress-tool.ts):
parseCompressInput(input, callId?, options: { quiet?: boolean } = {}),单个note()助手包住全部五处诊断日志(double-escape salvage / quote-salvage / flat-summary salvage / rejected / partial)——没有只静默 rejected 而漏掉另外四个的偏科。返回值与 salvage 采纳逻辑零改动,quiet 只影响是否打日志。✓ - 只有一个 quiet 调用点:src/stream.ts visibleSummaryStubs(#2749 扫描)。核对了全仓 parseCompressInput 的其余 8 个调用点——live 工具路径(loop/core.ts、stream-openai/responses、stream.ts:51)、preflight 合成输入(恒带 summary,不会 reject)、external-summary-compress live 路径(走 withOptionalSummaries 归一化)——全部保持原样告警,无修过头也无漏网。✓
- 备选方案放弃理由成立:body 说明扫描侧套 withOptionalSummaries 会引入 stream↔external-summary-compress 循环导入、且占位 summary 会让条目变成合法 range 污染 stub 收集。quiet 参数是更窄的正解。✓
- #2749 守卫判定不受影响:无 summary 条目解析出 0 range,永远进不了 stub 集——静默只是消音,不是放行。✓
- 测试双向门禁到位(tests/issue5161-compress-scan-log-noise.test.ts,#3617 纪律):正向=3 个 visible 无 summary 历史调用+1 次真实 fold ⇒ 零
[acp-compress-input]行且 fold 成功;反向①=真 live 无 summary 调用仍恰好一条 rejected warn(含 "missing summary" 理由);反向②=quiet 扫描仍收割真 stub 形状(199+safety 字符带)且无 summary 条目不贡献。用 logger 的 setLogCapture 程序化接缝断言,不靠 mock fs/log file。✓ - plugin-fork.test.ts 改动(+5/-4)是分支同步 master 时对 #5140 测试注释/格式的冲突解决(修正 legacy baseline 说明 + finally 单行化),非夹带行为变更。✓
非阻塞备注:
- 分支落后 master 50 commit(body 称干净合过 e193861),GitHub 判 MERGEABLE;我核对了 merge-base..tip 期间 master 对这三个文件的后续触碰,与 visibleSummaryStubs / parseCompressInput 区域无语义重叠,不构成同步阻塞,CI 会自动带 master 跑。
- 效果预期可复核:#5161 报告基线 ~553 行/天且随会话长度递增;此修复后该模式下的外部会话日志中
[acp-compress-input] rejected应只出现在真正失败的 live 调用上。
本地验证(正式全量留给远程 CI,head 轮已入队,不盯):
- 定向批 160/160 绿:issue5161 新套件 + stub-resubmission-guard + basic/proxy-basic + issue1494/issue1495 + compress-reject-reasons + external-summary-runtime + plugin-fork(即 body 列的全集)
tsc --noEmitexit 0- 无 kernel 改动、无配置/env 面变化 ⇒ 不触发 kernel-guard/version-guard ✓
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.954-master.f70055c # this exact build
npm install -g billion-context@master # always the newest merged build
|
修什么
#5161:external-summary 模式下,每次 compress 都会重解析所有可见的历史 compress 调用(#2749 守卫扫描
visibleSummaryStubs,src/stream.ts),每个无 summary 的条目被parseCompressInput打一条[acp-compress-input] rejected(reason=missing summary)warn。external 模式下模型的调用本来就不带 summary(advertised schema 把 summary 移出 required,src/external-summary-surface.ts:124;live 路径先经withOptionalSummaries补占位再解析),所以每 fold 一次 = 按「可见无 summary 调用数」各打一条误报,随会话变长 bursts 增长(报告实测 ~553 行/天、39 个 burst、每小时 70→97→122→169)。无任何 compress 真正失败——纯日志噪音 + O(可见调用数) 的重复解析。修法
parseCompressInput增加可选第三参options: { quiet?: boolean }:quiet 时抑制该次解析的全部诊断日志(rejected / partial / 三类 salvage),解析结果与 salvage 行为完全不变。仅 #2749 扫描处(src/stream.ts visibleSummaryStubs)传{quiet:true};其余 8 个 live 路径调用点保持原行为逐字节不变——真畸形 live 调用照常报警。未取备选方案(扫描侧套用
withOptionalSummaries归一化):会引入 stream ↔ external-summary-compress 循环导入,且改变解析语义(占位 summary 变成合法 range),比静默更侵入。行为变更披露(old → new)
[acp-compress-input] rejected … missing summarywarn → 0 条。live 路径日志不变。测试
新
tests/issue5161-compress-scan-log-noise.test.ts(3 测,#3617 双向门禁):[acp-compress-input]日志,且新 fold 成功;rejectedwarn(防修过头把真实拒绝吞掉);测试有牙验证:临时还原修复后第 1、3 测红,恢复后绿。
本地定向:本文件 +
tests/stub-resubmission-guard.test.ts(8/8)+ basic / proxy-basic / issue1494-compress-params / issue1495-partial-compress-drop / compress-reject-reasons / external-summary-runtime(合计 96/96);typecheck + build 绿。全量回归以 CI 为准。查重: 无(open+closed issue/PR 均无覆盖此日志噪音的条目;与 #2749 同代码路径但不同缺陷——#2749 是守卫机制本身)。
Closes #5161