Skip to content

fix: omit token count when no token data exists#854

Merged
gtrrz-victor merged 2 commits intomainfrom
fix/omit-tokens-no-checkpoints
Apr 6, 2026
Merged

fix: omit token count when no token data exists#854
gtrrz-victor merged 2 commits intomainfrom
fix/omit-tokens-no-checkpoints

Conversation

@peyton-alt
Copy link
Copy Markdown
Contributor

@peyton-alt peyton-alt commented Apr 3, 2026

Tokens are only calculated during checkpoint creation or condensation. Sessions with no file changes never get token data, so showing "tokens 0" is misleading — the real count is unknown. Now omits the tokens stat when totalTokens is 0. Sessions that were condensed (StepCount reset but TokenUsage preserved) still show their token count correctly.


Note

Low Risk
Low risk UI/UX change in CLI output: token stats are now hidden when TokenUsage is missing/zero, with added tests to prevent regressions.

Overview
Updates entire status and entire sessions output to omit the tokens stat when total token usage is 0/unknown, instead of showing tokens 0.

Adds coverage in status_test.go to ensure sessions without token data don’t print any tokens text, while sessions with recorded token usage still display the formatted count.

Reviewed by Cursor Bugbot for commit c3a901b. Configure here.

Tokens are only calculated during checkpoint creation or condensation.
Sessions with no file changes never get token data, so showing "tokens 0"
is misleading — the real count is unknown. Now omits the tokens stat
when totalTokens is 0. Sessions that were condensed (StepCount reset
but TokenUsage preserved) still show their token count correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 21de2958b95d
Copilot AI review requested due to automatic review settings April 3, 2026 23:39
@peyton-alt
Copy link
Copy Markdown
Contributor Author

Example:
token_0_status

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the CLI status/session list output to avoid displaying a misleading token count when token usage is unknown (e.g., sessions that never had token calculation performed).

Changes:

  • Omit the tokens … stat in active session/status output when totalTokens(TokenUsage) == 0.
  • Apply the same omission logic to session cards in entire sessions output.
  • Add tests covering omission when no token data exists and display when token data exists.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
cmd/entire/cli/status.go Only renders the token stat in active session status when total tokens are > 0.
cmd/entire/cli/status_test.go Adds tests asserting tokens are omitted when absent and shown when present.
cmd/entire/cli/sessions.go Updates session card rendering to only include tokens when total tokens are > 0.

Comment thread cmd/entire/cli/sessions.go
Aligns sessions info with status and sessions list — all three now
use totalTokens > 0 instead of TokenUsage != nil.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 1d3be4788329
@peyton-alt
Copy link
Copy Markdown
Contributor Author

@BugBot review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit c3a901b. Configure here.

@peyton-alt peyton-alt marked this pull request as ready for review April 3, 2026 23:56
@peyton-alt peyton-alt requested a review from a team as a code owner April 3, 2026 23:56
@gtrrz-victor gtrrz-victor merged commit b27ad71 into main Apr 6, 2026
4 checks passed
@gtrrz-victor gtrrz-victor deleted the fix/omit-tokens-no-checkpoints branch April 6, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants