stats: include cache tokens in averages #7568

Closed
opened 2026-02-16 18:07:37 -05:00 by yindo · 2 comments
Owner

Originally created by @bold84 on GitHub (Jan 25, 2026).

Originally assigned to: @rekram1-node on GitHub.

Problem

Cache read/write tokens are only shown in the overall totals; per-model stats don’t show cache reads/writes, and Avg/Median Tokens per Session excludes cache tokens. This under-reports usage when caching is used.

Current behavior

  • Cache tokens appear only in the totals section.
  • Per-model rows show input/output only.
  • Avg/Median uses input + output + reasoning only.

Expected behavior

  • Per-model stats should include cache read/write tokens.
  • Avg/Median should include cache read/write tokens for accurate totals.
Originally created by @bold84 on GitHub (Jan 25, 2026). Originally assigned to: @rekram1-node on GitHub. ## Problem Cache read/write tokens are only shown in the overall totals; per-model stats don’t show cache reads/writes, and Avg/Median Tokens per Session excludes cache tokens. This under-reports usage when caching is used. ## Current behavior - Cache tokens appear only in the totals section. - Per-model rows show input/output only. - Avg/Median uses input + output + reasoning only. ## Expected behavior - Per-model stats should include cache read/write tokens. - Avg/Median should include cache read/write tokens for accurate totals.
yindo closed this issue 2026-02-16 18:07:37 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 25, 2026):

This issue might be a duplicate of or related to existing issues. Please check:

  • #10240: feat: Add /stats command for token usage statistics (recently closed implementation)
  • #5555: [FEATURE]: Session-specific stats command and exit summary (feature request for stats with cache token breakdown)
  • #6767: [Feature Request] Implement /stats command for visual usage insights (related stats feature request)

These issues discuss the stats functionality and token usage calculations that your issue relates to. #10240 specifically mentions separating cache token stats, so your concern about cache tokens being excluded from Avg/Median calculations may have been addressed or partially addressed in that implementation.

Feel free to ignore if your specific issue about Avg/Median calculations has already been resolved in the latest implementation.

@github-actions[bot] commented on GitHub (Jan 25, 2026): This issue might be a duplicate of or related to existing issues. Please check: - #10240: feat: Add /stats command for token usage statistics (recently closed implementation) - #5555: [FEATURE]: Session-specific stats command and exit summary (feature request for stats with cache token breakdown) - #6767: [Feature Request] Implement /stats command for visual usage insights (related stats feature request) These issues discuss the stats functionality and token usage calculations that your issue relates to. #10240 specifically mentions separating cache token stats, so your concern about cache tokens being excluded from Avg/Median calculations may have been addressed or partially addressed in that implementation. Feel free to ignore if your specific issue about Avg/Median calculations has already been resolved in the latest implementation.
Author
Owner

@bold84 commented on GitHub (Jan 25, 2026):

The description edits happened because I read the contribution guidelines after the implementation. 😅

@bold84 commented on GitHub (Jan 25, 2026): The description edits happened because I read the contribution guidelines after the implementation. 😅
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7568