Skip to content

TUI plugin: sidebar_content slot never renders content (1.17.11) #34050

Closed as not planned

Description

@boyingliu01

Summary

After 2 weeks and 12+ attempts, a third-party TUI plugin registered via ~/.config/opencode/tui.json cannot render content in the sidebar_content slot. The plugin's tui() factory function IS called, api.slots.register() succeeds, but the content returned from sidebar_content never appears in the sidebar panel — even when returning the simplest possible value.

Environment

  • OpenCode version: 1.17.11
  • OS: Linux (WSL)
  • Plugin: @boyingliu01/opencode-plugin (published on npm, ./tui export points to tui-plugin.tsx)

tui.json configuration

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": ["@boyingliu01/opencode-plugin/tui"]
}

Evidence from 12+ experiments

Experiment 1: .tsx with @opentui/solid JSX (the intended plugin)

  • Module loads, tui() factory NOT called
  • Root cause: @opentui/solid was a peerDependency, not installed at ~/.config/opencode/node_modules/

Experiment 2: .tsx with @opentui/solid JSX (after installing deps)

  • After npm install brought in @opentui/solid@0.4.2 and solid-js@1.9.12
  • Module loads, tui() factory still NOT called
  • Sidebar content NOT rendered

Experiment 3: .ts with NO JSX, string return (import type only)

import type { TuiPlugin } from "@opencode-ai/plugin/tui"
const tui: TuiPlugin = async (api) => {
  api.slots.register({ slots: { sidebar_content: () => "TEST" } })
}
export { tui }
  • Module loads ✅
  • tui() factory function IS called ✅
  • sidebar_content returns plain string "TEST"
  • Sidebar content NOT displayed ❌

Experiment 4: BARE .ts with ZERO external imports

// NO imports from @opencode-ai/plugin/tui or @opentui/solid
// Only Node.js builtins: fs, os, path
const tui = async (api: any) => {
  // Writes to log file → confirms tui() IS called ✅
  api.slots.register({
    slots: {
      sidebar_content: (props: any) => {
        // Writes to log file → NEVER called ❌
        return "HELLO FROM XP-GATE"
      },
    },
  })
}
export { tui }
  • Module loads ✅
  • tui() factory IS called ✅ (log confirmed)
  • api.slots.register() succeeds ✅
  • sidebar_content render function NEVER called ❌
  • "HELLO FROM XP-GATE" never appears in sidebar ❌

What DOES work

The built-in sidebar slots (Context, MCP, LSP) render correctly in the same panel. The sidebar panel itself is functional.

Hypothesis

The sidebar_content slot in OpenCode 1.17.11 appears to require JSX.Element return type (from @opentui/solid), but:

  1. When using @opentui/solid JSX with /** @jsxImportSource @opentui/solid */, the module's tui() factory is never called (module loads, export not recognized)
  2. When NOT using JSX (returning plain string), tui() is called, slots register, but the render function sidebar_content is never invoked — as if the return type is rejected

This creates a deadlock:

  • JSX path → tui() never called
  • String path → tui() called, but content never rendered

Request

  1. Clarify the exact contract for sidebar_content: must it return JSX.Element? Are strings/renderables supported?
  2. If strings ARE supported, this is a bug in 1.17.11
  3. If strings are NOT supported, could the SDK expose a createElement() / h() function that doesn't require @opentui/solid as a runtime dependency? External plugins shouldn't need to depend on OpenCode's internal UI framework.
  4. Any working example of a third-party TUI plugin with sidebar_content would be immensely helpful

Related

  • Plugin npm: @boyingliu01/opencode-plugin@0.10.17
  • TUI plugin source: tui-plugin.tsx (uses @opentui/solid JSX), tui-plugin.ts (string-based fallback)
  • Package exports: "./tui" → "./tui-plugin.tsx"
  • Full diagnosis doc: available on request

Activity

  1. github-actions commented on Jun 26, 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 re-submit or edit using the appropriate template. For this report, the Bug Report template is appropriate and requires a structured Description field and reproduction steps.

    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.

  2. github-actions commented on Jun 26, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions