Add toggleable per-message token usage badges in chat UI - #6
Merged
Conversation
Agent-Logs-Url: https://github.com/namerror/context-estimator/sessions/58ef3fb3-962f-4f52-be21-42ec6af2665d Co-authored-by: namerror <44743690+namerror@users.noreply.github.com>
Agent-Logs-Url: https://github.com/namerror/context-estimator/sessions/58ef3fb3-962f-4f52-be21-42ec6af2665d Co-authored-by: namerror <44743690+namerror@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add toggle for per-message token usage display
Add toggleable per-message token usage badges in chat UI
Apr 7, 2026
namerror
requested changes
Apr 7, 2026
namerror
left a comment
Owner
There was a problem hiding this comment.
The displayed token label should be "x tokens, x%".
Also, enable display of per message token by default
Agent-Logs-Url: https://github.com/namerror/context-estimator/sessions/f9a19328-adfd-4f86-b7bf-5f6a8664bb38 Co-authored-by: namerror <44743690+namerror@users.noreply.github.com>
Contributor
Author
Updated in commit 68c3232: badge text now renders as |
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.
This updates the context estimator to show per-message token usage directly in the conversation view (enabled by default). Each badge displays estimated tokens and that message’s share of the selected model context window.
Overlay controls
Per-message usagetoggle in the Overrides section.showPerMessageUsagein settings defaults/storage handling.Estimation pipeline
{ tokens, contextPercent }when enabled.Message-level UI rendering
x tokens, x%.Docs