Skip to content

[FEATURE]: tokens-per-second in the desktop app (context usage indicator) #49380

Open

Description

@AOB-dot

Summary

The desktop app has no tokens-per-second readout. The TUI has a built-in per-response t/s in the assistant footer (plus a plugin ecosystem for live indicators), but desktop users cannot see throughput while agents run. The existing context usage indicator already surfaces cost, context usage %, and token counts on hover; adding tok/s there closes the gap with minimal UI.

Environment

  • opencode version: 0.0.0-beta-19425 (desktop beta)
  • OS: macOS 26.6.2 (Darwin 25.6.0, arm64)
  • Install/channel: desktop beta app
  • Plugins: none relevant — the desktop app has no plugin UI extension points

Proposal

Show live and settled tokens per second in the desktop app's context usage indicator (the progress circle in the session header and message timeline):

  • While streaming: an estimated live rate (e.g. ~51 t/s), counting output + reasoning deltas.
  • When the model step ends: settle to an exact rate from reported usage over the stream span, matching the TUI's built-in math.
  • On hover (where cost, context %, and total tokens already appear): include the last measured rate.
  • No new chrome; an optional display setting if needed.

Why this can't be a plugin

Desktop UI extension is not supported today: the UI plugin slots (@opencode/plugin/tui, OpenTUI renderables) are terminal-only, so only the app itself can add this.

Prior art

Additional context

Desktop sessions on this machine stream at rates where a live readout is genuinely useful (~50–180 t/s depending on model and step), and the only current workaround is a separate TUI instance or a home-grown sidecar.

Activity

  1. github-actions commented on Sep 16, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If the intent is specifically to track the desktop app implementation separately from the TUI work, it may be worth linking these issues to avoid duplicated effort.

  2. VladSmr commented on Oct 2, 2026

    @VladSmr

    The context-usage half of this works on Desktop today: /context gives an instant
    per-session summary and /context-breakdown a full per-category table
    (tokens-per-second isn't covered).

    I've built it as a plugin — opencode-context-indicator. Still in a testing
    stage; with your help and feedback we can make it better together.

    • per-category breakdown: system prompt, tool schemas, user/assistant text,
      reasoning, tool args, residual
    • /context-breakdown covers subagent sessions too — each child with its own
      ctx and %
    • dual V1 + V2, tested against opencode 2.0.21+; local only, no uploads

    https://github.com/VladSmr/opencode-context-indicator
    npm: opencode-context-indicator

  3. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for the detailed request, @AOB-dot! To restate it: you'd like the desktop app's context usage indicator to show tokens per second, as an estimate while a response streams and as a settled rate once the step ends, and to include the last measured rate in the hover details next to cost, context % and tokens.

    The desktop indicator doesn't calculate a rate today, so this would be new behaviour. Maintainers will consider it.

    A note on the plugin point: the current desktop code does have a GUI plugin SDK (@opencode/plugin/gui, loaded through a plugin's ./gui-experimental entry), but it's still experimental. The context indicator itself is built into the app, so adding the rate to its hover would need a change in the app rather than a plugin.

    Related items:

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions