Skip to content

Show output TPS in chat usage - #658

Merged
ericdallo merged 2 commits into
masterfrom
add-output-tps-usage
Oct 25, 2026
Merged

ericdallo merged 2 commits into
masterfrom
add-output-tps-usage

Conversation

@zikajk

@zikajk zikajk commented Oct 20, 2026

Copy link
Copy Markdown
Member

Measure streaming responses from the first generation event to the usage update and expose the result as messageOutputTps. Non-streaming requests and providers without usage keep the field absent.

  • I added a entry in changelog under unreleased section.
  • This is not an AI slop. (Please take a human time to write a comprehensive context about the problem, alternatives and rationale)

@zikajk

zikajk commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

@ericdallo I think this could be useful addition to the status line (next to the cost).
If you agree, do you want to improve clients?

Measure streaming responses from the first generation event to the usage
update and expose the result as messageOutputTps. The window ends before
tool execution so approval and tool time cannot lower the value.
Non-streaming requests and providers without usage keep the field absent.
@zikajk
zikajk force-pushed the add-output-tps-usage branch from 3b176b4 to 658f75f Compare October 20, 2026 16:27
@netlogics

Copy link
Copy Markdown
Contributor

Gets my vote. I would enjoy this feature.

@ericdallo

Copy link
Copy Markdown
Member

@zikajk yeah, just wanna avoid too many info in usage metrics, need to think the best way to show there but sounds good

@zikajk

zikajk commented Oct 21, 2026 •

Copy link
Copy Markdown
Member Author

@ericdallo That reminds me that some providers (openAI in my case, > 20$ subs don't have 5h limit) shows secondary - in the limit section which has no value.
image

@zikajk

zikajk commented Oct 24, 2026

Copy link
Copy Markdown
Member Author

@ericdallo Another option would be to show this next to the messages like we already do with time?

@ericdallo

Copy link
Copy Markdown
Member

@ericdallo That reminds me that some providers (openAI in my case, > 20$ subs don't have 5h limit) shows secondary - in the limit section which has no value.

Just fixed this on master @zikajk

will take a look at the PR + UX now

@ericdallo
ericdallo merged commit 2f30fad into master Oct 25, 2026
7 checks passed
ericdallo added a commit that referenced this pull request Oct 25, 2026
ChatGPT plans without a 5h limit report their weekly window in the
primary slot and leave the secondary one empty: 0% used, without a
duration and with a reset already past. It was still kept as a
window, labeled with its slot name and shown as already reset, so
clients rendered it with no value, e.g. `secondary — · 7d 37%` in
eca-emacs.

Skip slots that are unused and have no duration, from both the
response headers and the wham/usage endpoint, as the Codex CLI does
for the headers. Unused windows with a duration, like a fresh 5h
one, are still shown.

Reported in #658 (comment)

🤖 Generated with [ECA](https://eca.dev) (nubank-anthropic/opus-5.5 - max)

Co-Authored-By: eca-agent <git@eca.dev>
@ericdallo

Copy link
Copy Markdown
Member

Implemented as this, I believe it's good enough for now, let's see

image

ericdallo added a commit to editor-code-assistant/eca-emacs that referenced this pull request Oct 25, 2026
The server now sends messageOutputTps in the usage content
(editor-code-assistant/eca#658), the output tokens per second of the
last model response, measured from its first generated token to its
end, excluding tool runs and approval waits.

Show it with a new :tps mode-line module, added to the default
eca-chat-mode-line-format right after the elapsed time it joins, as in
"⏱ 42s · 87 tok/s". Being its own module, it can be moved or removed;
its leading separator is part of the new eca-chat-tps-format, to adapt
it to the new place. It hides while the speed is unknown, as for
non-streamed requests or after a compaction, when the server omits the
field, and ignores the speed of subagents.

🤖 Generated with [ECA](https://eca.dev) (nubank-anthropic/opus-5.5 - max)

Co-Authored-By: eca-agent <git@eca.dev>
@cpp977

cpp977 commented Oct 26, 2026 •

Copy link
Copy Markdown

Does the server send this new metric already for ollama, too?

@ericdallo

Copy link
Copy Markdown
Member

@cpp977 we implemented in a generic way that get the output-tokens and calculate it so it should work, but LMK if any issues

ericdallo added a commit to editor-code-assistant/eca-webview that referenced this pull request Oct 26, 2026
The server now sends messageOutputTps in the usage content
(editor-code-assistant/eca#658), the output tokens per second of the
last model response, measured from its first generated token to its
end, excluding tool runs and approval waits.

Show it as its own "87 tok/s" pill in the chat subheader, as eca-emacs
does with its own mode-line module, with a tooltip explaining what it
measures. It hides while the speed is unknown, as for non-streamed
requests, when the server omits the field. It comes after the usage so
that in a narrow side panel, where it may not fit, it wraps to its own
line instead of moving the context bar.

🤖 Generated with [ECA](https://eca.dev) (nubank-anthropic/opus-5.5 - max)

Co-Authored-By: eca-agent <git@eca.dev>
ericdallo added a commit to editor-code-assistant/eca-vscode that referenced this pull request Oct 26, 2026
…ader

Shows the output speed of the last model response, e.g. "87 tok/s", that
the server sends as messageOutputTps (editor-code-assistant/eca#658).

🤖 Generated with [ECA](https://eca.dev) (nubank-anthropic/opus-5.5 - max)

Co-Authored-By: eca-agent <git@eca.dev>
ericdallo added a commit to editor-code-assistant/eca-intellij that referenced this pull request Oct 26, 2026
…ader

Shows the output speed of the last model response, e.g. "87 tok/s", that
the server sends as messageOutputTps (editor-code-assistant/eca#658).

🤖 Generated with [ECA](https://eca.dev) (nubank-anthropic/opus-5.5 - max)

Co-Authored-By: eca-agent <git@eca.dev>
ericdallo added a commit to editor-code-assistant/eca-desktop that referenced this pull request Oct 26, 2026
…ader

Shows the output speed of the last model response, e.g. "87 tok/s", that
the server sends as messageOutputTps (editor-code-assistant/eca#658).

Also brings the chat messages copy fix made for VS Code 1.143, a
click-focusable messages scroller, harmless here.

🤖 Generated with [ECA](https://eca.dev) (nubank-anthropic/opus-5.5 - max)

Co-Authored-By: eca-agent <git@eca.dev>
ericdallo added a commit to editor-code-assistant/eca-web that referenced this pull request Oct 26, 2026
…ader

Shows the output speed of the last model response, e.g. "87 tok/s", that
the server sends as messageOutputTps (editor-code-assistant/eca#658).

Also brings the chat messages copy fix made for VS Code 1.143, a
click-focusable messages scroller, harmless here.

🤖 Generated with [ECA](https://eca.dev) (nubank-anthropic/opus-5.5 - max)

Co-Authored-By: eca-agent <git@eca.dev>
@cpp977

cpp977 commented Oct 26, 2026

Copy link
Copy Markdown

It works fine, I was just running stale lisp compiled files in eca-emacs. Sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants