Repository navigation
Closed as not planned
Closed as not planned
Copy link
Description
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,./tuiexport points totui-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/solidwas a peerDependency, not installed at~/.config/opencode/node_modules/
Experiment 2: .tsx with @opentui/solid JSX (after installing deps)
- After
npm installbrought in@opentui/solid@0.4.2andsolid-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_contentreturns 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_contentrender 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:
- When using
@opentui/solidJSX with/** @jsxImportSource @opentui/solid */, the module'stui()factory is never called (module loads, export not recognized) - When NOT using JSX (returning plain string),
tui()is called, slots register, but the render functionsidebar_contentis 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
- Clarify the exact contract for
sidebar_content: must it returnJSX.Element? Are strings/renderables supported? - If strings ARE supported, this is a bug in 1.17.11
- If strings are NOT supported, could the SDK expose a
createElement()/h()function that doesn't require@opentui/solidas a runtime dependency? External plugins shouldn't need to depend on OpenCode's internal UI framework. - Any working example of a third-party TUI plugin with
sidebar_contentwould be immensely helpful
Related
- Plugin npm:
@boyingliu01/opencode-plugin@0.10.17 - TUI plugin source:
tui-plugin.tsx(uses@opentui/solidJSX),tui-plugin.ts(string-based fallback) - Package exports:
"./tui"→"./tui-plugin.tsx" - Full diagnosis doc: available on request
Metadata
Metadata
Assignees
Labels
No labels
Activity
github-actions commentedon Jun 26, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
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:
tui()factory not being called for JSX-based plugins installed via npm spec, and thenode_modulesexclusion in the Solid transform preventing rendering. Your experiments 1 and 2 match this exactly; experiments 3 and 4 (string return, slot render function never called) may be an additional aspect or the same underlying issue.If you believe this was flagged incorrectly, please let a maintainer know.
github-actions commentedon Jun 26, 2026
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.