feat: status line 显示会话累计 tokens 和请求次数#98
Open
dengmik-commits wants to merge 1 commit into
Open
Conversation
Replace activeTokens (latest response only) with cumulative total_tokens from entry.usage and total_reqs from entry.usagePerModel, formatted as "tokens: 12.3k / 5 reqs".
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.
改动
buildStatusLine()中 tokens 展示从activeTokens(仅最近一次 API 响应)改为会话累计值:数据来源
totalTokens:entry.usage.total_tokens(会话累计,每次 API 调用累加)totalReqs:entry.usagePerModel各模型的total_reqs求和(已有跟踪链路)1.2k,>=10000 显示12k为什么不用 activeTokens
activeTokens存储的是最近一次 API 响应的total_tokens(session.ts:1221),只用于 compaction 阈值比较,不是累计值。entry.usage.total_tokens才是真正的会话累计。