Repository navigation
Description
- I have searched for existing issues before filing this
This is a focused follow-up to #20504 and #24376, which were automatically closed after periods of inactivity. The request remains relevant, but this proposal is narrowed to a concrete API for the current TUI implementation.
The TUI currently exposes slots for the application, prompt, sidebar, and global footer, but not for an individual assistant message. The assistant metadata footer is rendered directly in packages/tui/src/routes/session/index.tsx.
This prevents plugins from attaching information to the response that produced it. Useful examples include:
- Cache read/write counts and cache hit rate
- Tokens per second
- Provider latency
- Per-response cost
- Evaluation or debugging metadata
- A collapsed
+ Turn detailsrow that expands when clicked, similar to the existing+ Thoughtreasoning control
Please add an additive per-assistant-message slot, for example:
assistant_message_footer: {
session_id: string
message_id: string
message: AssistantMessage
parts: readonly Part[]
terminal: boolean
last: boolean
}The slot would be rendered after the assistant content and built-in metadata, inside the transcript scrollbox. The terminal flag would distinguish a completed response from intermediate assistant messages that end with tool calls. The last flag identifies the newest assistant message in the session, which may still be streaming, so plugins can render live footers.
The exact payload shape can be adjusted by maintainers. At minimum, the slot needs to identify the assistant message and its session. The default UI should remain unchanged when no plugin contributes content, and multiple plugins should be able to contribute in deterministic order.
This should not require a server or protocol change. The TUI already has the message, parts, token usage, cost, and completion state locally.
Prior related requests:
- #20504 requested additional TUI slots, including locations around the assistant metadata and subagent footer.
- #24376 proposed an
assistant_metadata_rightslot for throughput, cache statistics, cost, and provider latency. - #18969 requested persistent global footer items, which does not provide per-response association.
- #5971 requested session-level custom sidebar panels.
This proposal makes the per-assistant-message case explicit and adds support for block-level, expandable plugin content rather than only inline metadata.
Activity
cavokz commentedon Sep 12, 2026
Hello, any chance to have this triaged and maybe the connected PR reviewed?
[-][FEATURE]: Add a per-assistant-message footer slot to the TUI plugin API[/-][+]tui: Add a per-assistant-message footer slot to the TUI plugin API[/+]leoscricca commentedon Oct 28, 2026
I built a read-aloud plugin that adds Play/Pause, Stop, seek, and speed controls beneath each completed answer, including answers in session history.
Currently, I have to patch and rebuild OpenCode to put the controls there. An additive per-assistant-message TUI slot, with
sessionIDandmessageID, would let plugins use the existing message data and render interactive, theme-aware controls without a custom build or server changes. For example:The slot should also work for historical messages and allow multiple plugins to contribute without replacing OpenCode's built-in metadata.
Example from a locally patched OpenCode TUI; the conversation and playback are simulated for this screenshot.
opencodejr commentedon Oct 28, 2026
Thanks for the detailed and narrowly scoped proposal! You're asking for a per-assistant-message slot in the TUI plugin API, rendered after the built-in assistant metadata in the transcript, so plugins can show per-response information such as cache stats, throughput, latency, cost or an expandable "Turn details" row.
I checked the current v2 code, and this can't be done as a plugin yet. The slot tree (
SlotMapinpackages/plugin/src/tui/context.ts) only hasapp,home.footer*,prompt.footer*,session.composer.top,session.panelandsidebar.*. The assistant metadata inpackages/tui/src/routes/session/index.tsxisn't wrapped in a<Slot>, so plugins have nothing per message to attach to. One way to add it would be a newSlotMapentry keyed bysessionID/messageID, plus flags like yourterminal/last. The existingbefore/append/afterplacements would then handle ordering between multiple plugins.Related issues:
assistant_metadata_rightslot for similar per-response statsMaintainers will consider it.
cavokz commentedon Oct 28, 2026
For the record, #46562 is my intent to implement this new slot.