Repository navigation
Closed
Labels
needs:complianceThis means the issue will auto-close after 2 hours.This means the issue will auto-close after 2 hours.
Description
Summary
There is no way to see a live output speed (tok/s) while a model streams in the TUI, and no supported API for a third-party plugin to add one.
What I checked (opencode 1.18.29, Linux)
opencode.json/tui.json/ env vars expose no token-rate display option.@opencode-ai/plugin/tuitype surface advertises a full TUI plugin API (TuiSlotMapwithhome_footer,session_prompt_right,sidebar_footer,app_bottom, etc., plusapi.slots.register/api.event.on), but the runtime does not deliver it: an auto-discovered plugin file exportingtuiis invoked with the serverPluginInput(client, project, worktree, directory, serverUrl, $), andapi.slots/api.event/api.themeetc. areundefined. Only a client withtui/event/ptynamespaces is available.- The one rendering-ish control that does exist —
client.tui.showToast— neither resolves nor draws when called from a plugin (server- or tui-export). The promise never settles and no toast appears on screen.appendPromptetc. are in the same control family.
Suggested implementation
For streaming tokens/s we need two pieces:
- Exact per-delta token counts in the stream. Today
message.part.updatedonly carries the cumulativepart.text; realtokens.outputonly arrives onmessage.updatedat the end. Providers stream usage, and most estimate tokens/s by dividing characters — please surface a per-part or per-message.part.deltatoken delta (even approximate) with a timestamp so any consumer can compute an accurate instantaneous rate. - A statusline surface for plugins (or a built-in). Either:
- expose the already-built
slots/TuiSlotPluginhost surface to third-party plugins (fix thetuiexport input so it receives the documented TuiPluginApi), and document authoring (.tsx + Solid), or - ship a built-in optional live tok/s indicator in the message footer / header (the prompt bar already shows a context-token meter), toggled e.g. from the command palette.
- expose the already-built
Also worth fixing: client.tui.showToast should resolve and render for plugin callers, not hang forever.
Workaround (reference implementation)
Since a persistent in-TUI meter isn't reachable, I built a stop-gap for headless/scripted usage that reconstructs the stream from opencode run --format json and prints a live ⇣ N tok/s line plus an exact final average (calibrated on provider usage):
opencode run --format json "explain X" | oc-meteroc-meter (TypeScript/Bun) is intentionally small and mirrors the estimation/calibration math the statusline would need. Happy to adapt it into a PR once a slot or event delta exists.
Metadata
Metadata
Assignees
Labels
needs:complianceThis means the issue will auto-close after 2 hours.This means the issue will auto-close after 2 hours.
Activity
github-actions commentedon Sep 9, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
[FEATURE]:and use the feature request template (including the verification checkbox). The current title usesfeat:and the body follows a freeform structure rather than the required template.Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
If you believe this was flagged incorrectly, please let a maintainer know.
differs commentedon Sep 9, 2026
Superseded by #47914, which already tracks the same feature request (live tok/s in the status bar + config toggle + per-response average) in the required template. My technical findings (plugin slot API not delivered to third-party plugins,
client.tui.showToasthangs, no per-delta token usage in stream events) are attached as a comment on #47914, together with the reference meter implementation.