fix: correct OpenCode cache hit rates
Include cache reads and writes in the complete input denominator for OpenCode usage. Use the same calculation for stored records, summary totals, and renderer fallbacks so existing history is corrected without migration. Add regressions for full cache hits, cache writes, mixed Runtime aggregation, and persisted conversation/system usage. Focused validation passed 41 tests; repository-wide checks were blocked by concurrent work-mode changes. Release note: 修复 OpenCode 缓存命中率偏高或完全命中时显示为空的问题,已有用量记录在重新查询时按完整输入量计算。
This commit is contained in:
+3
-1
@@ -788,7 +788,9 @@ records are listed separately and do not introduce another feature status.
|
||||
without a persistent legacy-cache truncation warning; previously lost
|
||||
history is not restored. Token usage is grouped by Runtime and
|
||||
model and normalizes the different OpenAI-compatible and Anthropic Messages
|
||||
cache-reporting semantics when showing cache hit rate. Project and conversation
|
||||
cache-reporting semantics when showing cache hit rate. OpenCode usage adds cache
|
||||
reads and writes back to its uncached input count before calculating the rate,
|
||||
including when querying existing records. Project and conversation
|
||||
usage groups show collapsed totals by default and expand to Runtime/model child
|
||||
rows; model grouping remains flat. A separate System tasks tab groups
|
||||
background usage by source, with manual refresh and updates when usage is
|
||||
|
||||
Reference in New Issue
Block a user