Skip to content

Display blended token count in status line#21669

Merged
etraut-openai merged 1 commit into
mainfrom
etraut/statusline-blended-token-count
May 8, 2026
Merged

Display blended token count in status line#21669
etraut-openai merged 1 commit into
mainfrom
etraut/statusline-blended-token-count

Conversation

@etraut-openai
Copy link
Copy Markdown
Collaborator

@etraut-openai etraut-openai commented May 8, 2026

Why

The configurable /statusline and terminal title can display session token usage. That display was using the raw total token count, which includes cached input tokens, so it significantly overstated the token usage compared with the blended token count shown elsewhere (in /status and tracked in goals). This inconsistency resulted in user confusion. We don't want to report cached tokens because we don't charge for them and they are somewhat of an implementation detail that users shouldn't care about.

What changed

  • Use TokenUsage::blended_total() for the used-tokens status surface item so cached input is excluded.
  • Add a brief comment to tokens_in_context_window() clarifying that it returns raw total_tokens, whose meaning depends on whether the caller has last-turn or accumulated usage.

@etraut-openai etraut-openai changed the title Use blended token count in status surfaces Display blended token count in status line May 8, 2026
Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai left a comment

Choose a reason for hiding this comment

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

Did a quick run to make sure statusline work.

Code looks good, approved!

@etraut-openai etraut-openai merged commit f86d95a into main May 8, 2026
26 checks passed
@etraut-openai etraut-openai deleted the etraut/statusline-blended-token-count branch May 8, 2026 14:56
@github-actions github-actions Bot locked and limited conversation to collaborators May 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants