-
Notifications
You must be signed in to change notification settings - Fork 0
Omit token count in checkpoint metadata when no token data exists #164
Copy link
Copy link
Open
Labels
Description
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.TotalTokensfromintto*intwithjson:"total_tokens,omitempty"ininternal/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 --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.
Reactions are currently unavailable