Summary
SessionMetadata.TotalTokens is an int that defaults to 0 when token tracking didn't occur, making it indistinguishable from a session that genuinely used 0 tokens. Change it to *int with omitempty so the field is absent when unknown.
Source
entireio/cli PR #854: "fix: omit token count when no token data exists"
Proposed Change
- Change
SessionMetadata.TotalTokens from int to *int with json:"total_tokens,omitempty" in internal/checkpoint/metadata.go
- Only set the pointer in the post-commit hook when JSONL parsing actually found token usage data
- Display code in
partio rewind --list treats nil as "unknown" and skips the token field rather than showing "0 tokens"
Why This Matters
Displaying "0 tokens" implies the agent ran but consumed no tokens — confusing and inaccurate. If a token count is shown, it should be real data.
Summary
SessionMetadata.TotalTokensis anintthat defaults to0when token tracking didn't occur, making it indistinguishable from a session that genuinely used 0 tokens. Change it to*intwithomitemptyso the field is absent when unknown.Source
entireio/cli PR #854: "fix: omit token count when no token data exists"
Proposed Change
SessionMetadata.TotalTokensfromintto*intwithjson:"total_tokens,omitempty"ininternal/checkpoint/metadata.gopartio rewind --listtreatsnilas "unknown" and skips the token field rather than showing "0 tokens"Why This Matters
Displaying "0 tokens" implies the agent ran but consumed no tokens — confusing and inaccurate. If a token count is shown, it should be real data.