Repository navigation
[PR] fix: re-billing for compacted thinking reclamation (#651) was misreported as an unknown cache seam; now attributed separately (#3198) | [PR] fix: 压缩思考回收(#651)的重计费被误报为未知缓存接缝,改为单独归因 (#3198) - #3300
Conversation
每个压缩回合关闭时,reasoning-drop 会把该回合的思考内容从出站 视图移除——这是一次已知的中段历史改写,每次回合恰好重计费一次。 此前账本把这笔 miss 记成「⚠ CACHE SEAM(疑似中段前缀断裂)」, #3198 排查正是被这个无归因桶吓出来的。 现在 prepare-* 在 planReasoningDrop 之后上报计划 (noteReasoningDropPlan):计划增长=有回合新关闭,下一个大残差 miss 归因为 prov="reasoning" 的新桶,并在 /acp-cache 输出 「℞ COMPRESS-REASONING ROUND-CLOSE」一节(含 compress.reasoning. drop=false 的关闭方法),网页轨迹图同步新增该颜色桶。进程内首次 观测只做基线(重启后视图已稳定,不误借归因);打点消费一次即失效, 120 秒窗口兜底。
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3917-pr.3300.659f7cfThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3300.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…ng is a live i18n key The #3300 change added CAUSE_COLOR.rd / CAUSE_KEY.rd and the prov==='reasoning' cause mapping but never pushed a legendItem() for the new bucket, so the purple segment rendered unlabeled AND the i18n dead-key guard (#1024) failed because t("det.leg_reasoning") was never referenced. Add the swatch mirroring its siblings (color matches CAUSE_COLOR.rd = #8250df).
#3300 adds reasoningDropMisses/reasoningDropMissed to the cache-ledger agg, which persists inside session.metadata, so the digest-based storage-render snapshots drift (only the metadata section hash changes; state/blockContents/ stats unchanged). Regenerate via scripts/update-storage-render-goldens.ts. Additive, zero-default, backward-compatible fields (backfilled on load); no persistence version bump.
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 本 PR 是把 #3198 排查结论落地成代码的实现,和它引用的两个条目都不重叠:#651 是被归因的 drop 机制本体,#3198 是排查过程;这里只动账本归因,不是对任一在途修复的重复。未见到做同样「reasoning 单独归因」的并行 PR。 我独立审了这条 PR(没有照抄 issue 侧结论),并在本地真实复现了它的两处 CI 破坏、定位根因、就地修好并推回本分支( 我验证了什么
发现并已修复的两处回归(都在本分支补了 commit)
结构化八问
收工判定本地 typecheck + 相关套件全绿,两处回归已修复推送。建议:rebase 到当前 master 后再合并——该分支落后 master 约 29 个提交,而且 master 已经推进了 storage-corpus(11 个文件),rebase 后 storage-render golden 需要再跑一次 |
Sync master (incl. #3266 image-precompression removal) into the PR branch. Conflict only in tests/golden/storage-render/*.json (both sides regenerated since base): resolved by taking master's fixtures and re-running scripts/update-storage-render-goldens.ts on the merged tree so the snapshots match post-#3266 code plus #3300's two new persisted ledger counters. Verified on this tree: typecheck clean; golden-storage-render + web-i18n + cache-seam-* + cache-ledger suites 81/81 green.
…det.leg_reasoning was a dead i18n key (#3198) The /acp-cache detail page paints the 'rd' cause (#8250df) on the chart and names it in the tooltip, but the unattributed family's sub-legend never rendered a row for it, so the catalog key #3300 added was referenced by no rendered surface (tests/web-i18n.test.ts dead-key gate). Add the conditional row alongside the other seam sub-causes.
…uckets (#3198) detailSeam() tolerates servers predating each attribution bucket by defaulting absent fields to zero — #3300's legend row reads seam.reasoningDrop.count without that tolerance, so any payload whose seam lacks the field (test fixtures, older server builds) throws during loadDetail and the trajectory never binds (#2489 brush tests time out in waitFor). Add the missing normalization line; behavior for current server payloads is unchanged.
…the stack merge dropped them (#3198) The merge of master into this branch silently took master's stale storage-render goldens instead of #3300's regeneration (7e5708e), so the digest-based snapshots failed on all four wires even though this tree's persisted state matches #3300's digests exactly (verified by A/B dumpStateTo against merge-base: only metadata.cacheLedger.agg differs, and those two fields are what 7e5708e pinned). Restore the four files verbatim from 4dee7e9; no re-run of the regen script was needed because the digests already agree with this tree.
…uckets (#3198) detailSeam() tolerates servers predating each attribution bucket by defaulting absent fields to zero — the legend row added in 491d52a reads seam.reasoningDrop.count without that tolerance, so any payload whose seam lacks the field (test fixtures, older server builds) throws during loadDetail and the trajectory never binds (#2489 brush tests time out in waitFor). Add the missing normalization line; behavior for current server payloads is unchanged.
(ai: vllm-qwen/qwen3.8-27b) CI 里两个 #2489 brush 测试超时(u24s1)的根因已定位并修复,推送 97ce469。
修复 = 补一行与兄弟桶同模式的归一化( 另注:#3311 合并时误丢了本分支的 491d52a(legend 行)和 7e5708e(金标重生成)两个 commit——已在 #3311 侧原样恢复并留言,与本分支无冲突预期(rebase 时两行自然收敛)。 |
(ai: vllm-qwen/qwen3.8-27b) 冲突处置完成。分支现在包含最新 master,文本冲突已消除(GitHub 状态 mergeable,仅剩 checks 阻塞);期间从 CI 日志里发现并确认了本 PR 自己引入的一个真实回归,已在分支上修复并通过本地 A/B 验证。 结构化八问:
验证证据(本地定向复现,非全量):同一测试文件在旧头 判定:冲突已解决、PR 引入的回归已修复并验证,无需再次推送;剩余红灯均为 master 存量且已有对应条目跟踪(#3317、#3314/#3320)。等最后 4 个分片跑完即可合入。 |
|
冲突 |
# Conflicts: # tests/golden/storage-render/anthropic.json # tests/golden/storage-render/chat.json # tests/golden/storage-render/google.json # tests/golden/storage-render/responses.json
(ai: vllm-qwen/qwen3.8-27b) 冲突已解决并推送,PR 状态 dirty → blocked(等待新 head 的 CI)。 发生了什么:上一轮唤醒后 master 又前进了一批合并(#3284 pi-inline、#3317 T5 filler、#3314 golden 重基线、#3312 host-plugin-notice),分支里已有的 master 合并点不再是最新 tip,GitHub 重新判了 dirty。 怎么解的:把当前 master 合进分支,共两个 merge commit—— 八问:
已知红项说明:AC12 multi-hop、#1086 T5 liveness 在 master 上本来就是红的(各有跟踪条目),不属于本 PR。CI 在新 head |
|
(ai: zhipuai-lb/glm-5.3) 孤儿票清理:标题指向的 issue 已关闭,修复已由其他路径落地。关单;误判请 reopen。 |
坏了什么
每个压缩回合关闭时,reasoning-drop(
compress.reasoning.drop,默认开)会把该回合的 reasoning 从出站视图移除——这是一次已知的中段历史改写,每个回合恰好带来一次前缀重计费。此前账本把这笔 miss 记进「⚠ CACHE SEAM(疑似中段前缀断裂)」这个无归因桶,#3198 的排查正是被它吓出来的(本地实测:回合关闭请求 99%→91%,3.3K 重计费,bili.log 每请求都在打compress-reasoning: dropped ... (#651),但 /acp-cache 只显示未知接缝)。改动
src/cache-ledger.ts:新增noteReasoningDropPlan(session, plan)——prepare-* 在planReasoningDrop之后上报 drop 计划;计划增长 = 有压缩回合新关闭,下一个大残差 miss 被detectSeam归因为新桶prov="reasoning"(aggreasoningDropMisses/reasoningDropMissed,/acp-cache新增「℞ COMPRESS-REASONING ROUND-CLOSE (Protected-message exemption inflates the incompressible context floor: per-compression reasoning is never reclaimable (~83.5% of measured residual) #651)」一节,写明这是 drop 的已知成本、compress.reasoning.drop=false可关)。src/server/prepare-{openai,anthropic,responses}.ts:调用点各一行(openai chat / anthropic / responses 三条线;google 无 reasoning 概念)。src/web/client.ts+src/web/i18n.ts(中英):轨迹图新增紫色桶 ℞ 压缩思考回收。tests/cache-seam-reasoning-drop.test.ts(4 用例:增长记账/重启基线不误借/打点只消费一次/无增长不记)。不改的东西(有意)
compress.reasoning.drop:false)。本 PR 只把账记对——「已知成本」和「未知故障」必须分桶,否则每次都会再触发一轮 A/B experiment: ACP_RENDER_NONE=1 (renderTags=none) eliminates dsh render seams — hit rate 85.6% -> 91.2% #3198 式排查。默认值的调整留给 owner 决定。证据
config surface
无新增/变更配置字段(只读现有
compress.reasoning.drop并在报告里提示)。kernel 无改动。Refs #3198