GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tui: plugin sidebar slot never repaints on plugin state changes · Issue #66252 · anomalyco/opencode

tui: plugin sidebar slot never repaints on plugin state changes #66252

New issue
Copy link
New issue
Copy link
Duplicate
Duplicate
tui: plugin sidebar slot never repaints on plugin state changes#66252
Copy link
Labels
area/pluginsPlugins, skills, custom agentsplatform/linuxLinuxtype/bugSomething is brokenversion/v2OpenCode 2.x

Description

@CarlosCocheroB-DC
CarlosCocheroB-DC
opened on Nov 25, 2026
Issue body actions

Summary

A TUI plugin that renders into sidebar.content cannot refresh its own content: state changes made by the plugin (signals, host stores, requestRender()) never repaint the slot. The slot only updates when the host re-renders for an unrelated reason, for example a mouse click on the plugin's own header or a session switch.

Environment

  • opencode version: 2.4.1
  • OS: Linux 7.0.0-44-generic (x64)
  • Terminal: TERM=xterm-256color, COLORTERM=truecolor
  • Shell: /bin/bash
  • Install/channel: latest (Homebrew build)
  • Active plugins: [email protected], [email protected], [email protected] (TUI plugins listed in ~/.config/opencode/cli.json → plugins)

Reproduction

  1. Create a TUI plugin package (entry ./tui) that registers a sidebar slot:
/** @jsxImportSource @opentui/solid */
import { Plugin } from "@opencode/plugin/tui";
import { createSignal } from "solid-js";

export default Plugin.define({
  id: "repro.slot",
  setup(context) {
    const [n, setN] = createSignal(0);
    setInterval(() => setN((v) => v + 1), 1000);
    context.ui.slot({
      prepend: "sidebar.content",
      render: () => <text>{`tick ${n()} ${Date.now() % 100000}`}</text>,
    });
  },
});
  1. Register it in ~/.config/opencode/cli.json → plugins and open a session.
  2. Watch the line for a minute.

Expected Behavior

The rendered value changes every second (and on every re-render), because the signal is read inside the slot render.

Actual Behavior

The line is frozen at its first value for as long as the session stays open. The setInterval runs (verified with a file log: 3 ticks in 30s), but the slot is never re-evaluated. Clicking the plugin's header (which mutates a durable store read by the slot) or switching session repaints it once, with the newest data.

Additional Context

Measured on opencode-costs-tui 2.1.2, which shows cost/tokens for the active session and its subagents. Verified independently:

  • Timer fires: a probe inside the refresh function logged 3 calls in 30s.
  • Data is fresh: context.client.session.list({ directory }) and GET /api/session/{id} returned tokens.output: 41 while the panel still displayed 37.
  • The component is not re-evaluated: a Date.now() % 100000 marker rendered inside the slot stayed byte-identical across 24s of captures.
  • Writes to context.storage.store(...) and context.storage.memory(...) do not repaint either.
  • context.renderer.requestRender() after each update has no effect.

Workarounds that do repaint: any host-driven interaction with that slot (mouse click on a clickable element of the plugin, session switch).

Related: the TUI session store is also not refreshed for subagent sessions while they run, and context.data.session.sync(id) can stay pending forever, which is why the plugin reads sessions over HTTP instead.

Activity

  1. opencodejr commented on Nov 25, 2026

    @opencodejr
    opencodejrBot
    on Nov 25, 2026
    Contributor
    More actions

    Thanks for the detailed report and the measurements. I think this is a duplicate of #39986.

    The plugins you list ([email protected] and the others) are loaded as packages, so they run from OpenCode's npm cache under node_modules. #39986 tracks exactly that case. Such plugins draw their first frame, then never repaint when a signal or store changes, because the plugin ends up with a separate Solid reactive graph from OpenCode's. Either its JSX is not compiled by the Solid transform under node_modules, or it loads its own copy of solid-js / @opentui/solid. That matches what you saw: requestRender() does nothing, and the slot only updates when OpenCode itself redraws.

    Possible duplicates and related issues, ordered from most to least likely:

    • tui: support reactive external TSX plugins in packaged CLI #39986: the open, reproduced issue for this problem. Its comments describe workarounds plugin authors use today: a TUI entry with no JSX syntax that imports solid-js, @opentui/solid/jsx-runtime and @opencode/plugin/tui through the opentui:runtime-module:* ids, or shipping the TUI entry precompiled with babel-preset-solid. They also link an OpenTUI-side fix proposal (solid: add include option to transform JSX inside node_modules opentui#1741).
    • TUI plugin from an npm package: solid-js signal updates do not re-render slots #62666: the same repro (a signal in a slot of an npm-installed plugin), closed as a duplicate of tui: support reactive external TSX plugins in packaged CLI #39986.
    • tui: npm package TUI plugins render once and never update (dual solid-js runtime from node_modules resolution) #48883: the same symptom, traced to a second solid-js runtime in the package's node_modules.
    • tui: plugin slot contents never re-render on reactive updates #59458: a similar report for a local plugin folder; it could not be reproduced there and was closed.

    I'm closing this issue now as a duplicate of #39986. Please add your details there, especially that it still happens on 2.4.1 with opencode-costs-tui. If this is a different problem (for example, if your minimal repro also freezes when loaded by absolute path from a folder outside node_modules), reply here and this issue will reopen. The subagent session store and the context.data.session.sync(id) hang you mention are separate problems. Please open a separate issue for them if they still happen.

  2. opencodejr
    closed this as a duplicateof tui: support reactive external TSX plugins in packaged CLI #39986 on Nov 25, 2026
  3. opencodejr
    added
    area/pluginsPlugins, skills, custom agents
    platform/linuxLinux
    type/bugSomething is broken
    version/v2OpenCode 2.x
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/pluginsPlugins, skills, custom agentsplatform/linuxLinuxtype/bugSomething is brokenversion/v2OpenCode 2.x

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.