fix(usage): 修正缓存输入重复计数与旧基线迁移#430
Open
liuyix wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
Botmux v1 usage ledger 对 inputTokens 的缓存语义不明确。Codex、TraeX 和 Aiden 的原始 input token 已包含 cache read/create 子集,但 ledger 又把缓存写入独立字段,导致按互斥桶汇总的消费者把缓存输入重复计入 Total Token。
Kaboo 的真实现象是 Total Token 和成本虚高、缓存命中率偏低,并进一步抬高 tokens/codeLines 比率。Kaboo CLI 的历史兼容修复位于 seed/kaboo!552;本 PR 修复 Botmux 生产端,阻止新错误继续产生。
改动
影响范围
验证
并行全量测试曾在既有 workflow-fanout 临时目录清理中出现 ENOENT;该文件单跑 6/6,通过串行全量得到 clean exit 0,未在本 PR 扩大范围处理该竞态。