Skip to content

v2: external TUI plugins declared in tui.json are never loaded #36525

Closed

Description

@dmmop

Summary

External TUI plugins declared in ~/.config/opencode/tui.json are not registered or executed in opencode2 v0.0.0-next-15356. Their slash commands do not appear, and the TUI Plugin Manager is empty.

This prevents external plugins from using the public TUI APIs for keymaps, toasts, dialogs, routes, and slots.

Environment

  • opencode version: opencode2 v0.0.0-next-15356
  • OS: Linux david-Stealth-15-A13VF 7.0.0-27-generic x86_64
  • Terminal: TERM=xterm-256color, TERM_PROGRAM=ghostty, COLORTERM=truecolor
  • Shell: /usr/bin/zsh
  • Install/channel: next
  • Active plugins:
    • TUI config: @ishaksebsib/opencode-tree, @slkiser/opencode-quota, oc-tps@latest, and one local plugin path.
    • Server config: @slkiser/opencode-quota@latest, oc-tps@latest, opencode-vibeguard@latest, @ishaksebsib/opencode-tree@latest, context-mode@latest, and one local plugin path.
    • Local server plugins: opencode-codex-identity-plugin.ts, orchestator.ts, pushover-notifier.ts, and rtk.ts.

Reproduction

  1. Add a known TUI plugin to ~/.config/opencode/tui.json:

    {
      "plugin": [
        "@ishaksebsib/opencode-tree"
      ]
    }
  2. Start a private TUI instance:

    opencode2 --standalone
  3. Open the command palette and search for the plugin command, for example /tree.

  4. Open Plugins from the command palette.

Expected Behavior

  • The TUI should resolve the external package declared in tui.json.
  • The plugin's default.tui(api, options, meta) callback should run.
  • Its registered commands should appear in the command palette and as slash commands.
  • The Plugin Manager should show the configured external plugin and allow it to be activated or deactivated.

Actual Behavior

  • /tree does not appear.

  • The Plugin Manager is empty.

  • No external TUI plugin command is registered.

  • The same behavior occurs with a minimal local TUI module exporting:

    export default {
      id: "opencode-tui-test",
      tui: async (api) => {
        api.keymap.registerLayer({
          commands: [
            {
              namespace: "palette",
              name: "test-toast",
              title: "Show test toast",
              slashName: "test-toast",
              run: () => api.ui.toast({ message: "Loaded" }),
            },
          ],
        })
      },
    }
  • Server logs show the module being imported, for example:

    msg="loading plugin" id=@ishaksebsib/opencode-tree@latest entrypoint=file:///.../@ishaksebsib/opencode-tree/dist/tui.js role=server
    

    However, this does not result in the plugin running inside the TUI.

Additional Context

The issue reproduces consistently after fully restarting OpenCode and when using --standalone.

Inspection of the opencode2 binary suggests that the TUI bootstrap currently wires pluginHost.start(...) to a loader that iterates only a static list of built-in TUI plugins. The external plugin runtime remains initialized with an unavailable fallback:

Plugin runtime is not available.

The runtime's fallback returns false for activate, deactivate, and add, while its plugin status list remains empty. This matches the empty Plugin Manager and absent external commands.

The public @opencode-ai/plugin/tui API in this version exposes keymap, ui.toast, ui.dialog, routes, and slots, but external packages do not receive this API because their TUI target is never invoked.

Activity

  1. github-actions commented on Jul 12, 2026

    @github-actions
    Contributor

    This issue appears to be a duplicate of #36505, which reports the same root cause: external TUI plugins configured in tui.json are parsed but never loaded because the TUI pluginHost only calls loadBuiltinPlugins.

    Please check #36505 and consider closing this one in favor of the existing report.

  2. opencode-agent commented on Jul 12, 2026

    @opencode-agent
    Contributor

    We’re actively working on the new TUI API right now. This plugin-loading path is part of that ongoing work.

  3. opencode-agent commented on Jul 30, 2026

    @opencode-agent
    Contributor

    Addressed by the V2 TUI plugin-runtime work now on v2, notably commits fe91698, 068c32d, f599f8f, and 0629090. External package/local TUI modules are resolved and activated with the public TUI context, project plugins are discovered, and the Plugin Manager lists and controls registrations. Legacy config fields migrate to the current plugin directives. Closing as resolved on the v2 branch.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions