Repository navigation
feat(tui): drop the live rate, report tokens per second when the turn ends - #422
Merged
Merged
Conversation
… ends
Characters per second measured the wrong thing. It moved with how verbose the
model was being rather than how fast it was going, so the number swung between
a paragraph and a code block with nothing having actually changed — and it was
the one figure on the live line a reader might try to compare between runs.
The rate moves to the turn summary, where it can be a measurement instead of
a proxy: the provider's own completion-token count for this turn, taken as the
difference between cumulative session usage and what it stood at when the turn
began.
✓ Answered in 6s · 1.0k chars · 28 tok/s
Completion tokens only — prompt tokens are not produced over the turn's
duration, so counting them would inflate a generation rate with work that took
no time. Wall time, not model time: a turn that spent nine of its ten seconds
running tools did not generate at the rate the model alone managed, and the
reader is timing the turn they waited through.
Nothing is reported when the provider sent no usage, when it reported zero, or
when the turn ran under a second — a rounding error can double a rate at that
scale. The live line keeps its character count, which stays honest: no
provider reports token usage while the stream is open.
Claude-Session: https://claude.ai/code/session_01PRJa3oW3o66f48FynE3MoM
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
… ends (#422) Characters per second measured the wrong thing. It moved with how verbose the model was being rather than how fast it was going, so the number swung between a paragraph and a code block with nothing having actually changed — and it was the one figure on the live line a reader might try to compare between runs. The rate moves to the turn summary, where it can be a measurement instead of a proxy: the provider's own completion-token count for this turn, taken as the difference between cumulative session usage and what it stood at when the turn began. ✓ Answered in 6s · 1.0k chars · 28 tok/s Completion tokens only — prompt tokens are not produced over the turn's duration, so counting them would inflate a generation rate with work that took no time. Wall time, not model time: a turn that spent nine of its ten seconds running tools did not generate at the rate the model alone managed, and the reader is timing the turn they waited through. Nothing is reported when the provider sent no usage, when it reported zero, or when the turn ran under a second — a rounding error can double a rate at that scale. The live line keeps its character count, which stays honest: no provider reports token usage while the stream is open. Claude-Session: https://claude.ai/code/session_01PRJa3oW3o66f48FynE3MoM
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
… ends (#422) Characters per second measured the wrong thing. It moved with how verbose the model was being rather than how fast it was going, so the number swung between a paragraph and a code block with nothing having actually changed — and it was the one figure on the live line a reader might try to compare between runs. The rate moves to the turn summary, where it can be a measurement instead of a proxy: the provider's own completion-token count for this turn, taken as the difference between cumulative session usage and what it stood at when the turn began. ✓ Answered in 6s · 1.0k chars · 28 tok/s Completion tokens only — prompt tokens are not produced over the turn's duration, so counting them would inflate a generation rate with work that took no time. Wall time, not model time: a turn that spent nine of its ten seconds running tools did not generate at the rate the model alone managed, and the reader is timing the turn they waited through. Nothing is reported when the provider sent no usage, when it reported zero, or when the turn ran under a second — a rounding error can double a rate at that scale. The live line keeps its character count, which stays honest: no provider reports token usage while the stream is open. Claude-Session: https://claude.ai/code/session_01PRJa3oW3o66f48FynE3MoM
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.
Moves the throughput figure off the live turn line and onto the turn summary,
where it can be a measurement rather than a proxy.
Why the live rate went
Characters per second measured the wrong thing. It moved with how verbose the
model was being rather than how fast it was going, so the number swung between
a paragraph and a code block with nothing having actually changed — and it was
the one figure on the live line a reader might reasonably try to compare
between runs.
The live line keeps its character count, which stays honest for the reason it
was chosen in the first place: no provider reports token usage while the
stream is still open, so a token count there would be an estimate presented
as a measurement.
What the summary gained
Once the turn is over the provider's own usage figures are in hand, so the
rate can be real: this turn's completion tokens, taken as the difference
between cumulative session usage and what it stood at when the turn began.
Three deliberate choices, each of which will show up in the numbers:
duration, so counting them would inflate a generation rate with work that
took no time.
running tools did not generate at the rate the model alone managed, and the
reader is timing the turn they waited through. A tool-heavy turn will show a
low
tok/s, which is intended — but it does mean the figure is not a cleanmodel-speed benchmark.
usage, when it reported zero, or when the turn ran under a second, where a
rounding error can double the rate.
Verification
Driven in a real tmux PTY at 150x40 against a live provider: the streaming
line shows
4.3s · ↓ 363 charswith no rate, and the turn closes✓ Answered in 6s · 1.0k chars · 28 tok/s. Tests cover the rate arithmetic,each of the three silence cases, and the fact that tool time counts toward the
denominator.
cargo fmt,cargo clippy --all-targets(zero warnings) andcargo test --workspace(zero failures) are green.https://claude.ai/code/session_01PRJa3oW3o66f48FynE3MoM