Skip to content

TUI: No way for plugins to customize tool rendering — need extensible TUI #21018

Closed as duplicate

Description

@markokraemer

Problem

The web UI has ToolRegistry.register() — plugins can register custom renderers for any tool. The TUI has nothing like this. Tool rendering is a hardcoded Switch block.

Plugin tools always render as a plain ⚙ tool_name [args...] text line. No click, no interactivity, no custom UI.

What the web UI can do that the TUI can't

The web UI lets plugins register renderers per tool name:

ToolRegistry.register({
  name: "my_tool",
  render(props) { /* full SolidJS component */ }
})

The TUI has zero extensibility for tool parts. Every plugin tool falls through to GenericTool.

Concrete example

The native task tool gets a clickable renderer — shows progress, click navigates to child session. A plugin tool that does the exact same thing (spawns a child session, sets metadata.sessionId) renders as flat text because only tool === "task" gets the nice renderer.

Request

Make the TUI extensible for tool rendering. Some options:

  1. Tool registry in TUI — like the web UI's ToolRegistry, let TUI plugins register custom renderers per tool name
  2. Metadata-aware GenericTool — if any tool sets metadata.sessionId, make it clickable (navigate to child session on click). Simplest possible fix, ~5 lines
  3. Slot for tool parts — add a TUI plugin slot so plugins can inject custom tool part UI

Any of these would make the TUI fully extensible for plugins. Right now plugins can add tools, commands, sidebar content, routes — but can't touch how their tools render in the timeline.

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Apr 4, 2026
  2. github-actions commented on Apr 4, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • The issue does not use one of the three required issue templates (Bug Report, Feature Request, or Question). Please resubmit using the appropriate template. Since this appears to be a feature request, the title should also start with [FEATURE]: and include the required verification checkbox.

    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.

  3. changed the title [-]TUI: Plugin tools can't customize tool part rendering (no tool registry like web UI)[/-] [+]TUI: No way for plugins to customize tool rendering — need extensible TUI[/+] on Apr 4, 2026
  4. github-actions commented on Apr 4, 2026

    @github-actions
    Contributor

    Thanks for updating the issue — the content itself looks good and specific. However, it still needs a couple of template requirements addressed:

    1. Title must start with [FEATURE]: — please update the title to begin with [FEATURE]: (e.g., [FEATURE]: TUI: No way for plugins to customize tool rendering)
    2. Verification checkbox is required — the Feature Request template requires you to confirm: "I have verified this feature I'm about to request hasn't been suggested before." Please add this to the issue body.

    Once those two items are addressed, this will be fully compliant.

  5. Pantkartik commented on Apr 4, 2026

    @Pantkartik

    [FEATURE]: Extensible Tool Rendering System for TUI
    Summary
    Introduce an extensible tool rendering system in the TUI to allow plugins to define custom UI for their tools, similar to the web UI’s ToolRegistry.
    Motivation
    Currently, the TUI uses a hardcoded switch-based renderer. Plugin tools fall back to a generic text-based output with no interactivity or customization.
    Limitations:
    No way for plugins to customize tool rendering
    No support for interactive behaviors (e.g., click navigation)
    Metadata (e.g., sessionId) is ignored in rendering
    Inconsistent behavior compared to the web UI
    Proposed Solution
    Provide extensibility through one or more of the following:
    Tool Registry (Preferred)
    Add a registry in the TUI where plugins can register custom renderers per tool:
    ToolRegistry.register({
    name: "my_tool",
    render(props) {
    // custom TUI renderer
    }
    });
    Metadata-aware Generic Renderer (Minimal Fix)
    Enhance the default renderer:
    If metadata.sessionId exists → make the tool clickable
    Enable navigation to the related session
    Plugin Rendering Slot
    Introduce a plugin hook/slot to inject custom UI into tool rendering
    Benefits

    • Enables full plugin extensibility in TUI
    • Brings feature parity with web UI
    • Supports interactive and metadata-driven rendering
    • Improves developer experience for plugin authors
    • Trade-offs
    • Slight increase in complexity in the TUI rendering layer
    • Need to maintain backward compatibility with existing tools
    • Implementation Plan
    • Introduce a Tool Registry in TUI
    • Add fallback to GenericTool if no custom renderer exists
    • Enhance GenericTool with basic metadata handling
    • Expose plugin API for registration
    • Add examples and documentation
    • Self-Service

    I am willing to work on an initial implementation, starting with the metadata-based enhancement and extending it to a full registry system.

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

Metadata

Metadata

Assignees

Labels

needs:complianceThis means the issue will auto-close after 2 hours.opentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions