anomalyco / anomalyco/opencode

tui: Add a per-assistant-message footer slot to the TUI plugin API

Open
#46,268 1 comment 1 reaction 1 assignee View on GitHub

@simonklee is already working on this.

Since Aug 30, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

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 details row that expands when clicked, similar to the existing + Thought reasoning 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_right slot 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.