fix: omit token count when no token data exists#854
Merged
gtrrz-victor merged 2 commits intomainfrom Apr 6, 2026
Merged
Conversation
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
Contributor
Author
Contributor
There was a problem hiding this comment.
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 whentotalTokens(TokenUsage) == 0. - Apply the same omission logic to session cards in
entire sessionsoutput. - 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. |
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
Contributor
Author
|
@BugBot review |
There was a problem hiding this comment.
✅ 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.
pjbgf
approved these changes
Apr 4, 2026
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.

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
TokenUsageis missing/zero, with added tests to prevent regressions.Overview
Updates
entire statusandentire sessionsoutput to omit thetokensstat when total token usage is 0/unknown, instead of showingtokens 0.Adds coverage in
status_test.goto ensure sessions without token data don’t print anytokenstext, while sessions with recorded token usage still display the formatted count.Reviewed by Cursor Bugbot for commit c3a901b. Configure here.