Stop letting @thdxr push :)
Summary
Running the built-in /btw slash command crashes the TUI after the generated answer is returned. The answer dialog attempts to access PluginProvider outside its context boundary.
Environment
- opencode version: 2.0.8
- OS: macOS 25.6.0 (arm64)
- Terminal: Ghostty 1.3.1 (
TERM=xterm-ghostty, COLORTERM=truecolor)
- Shell:
/bin/zsh
- Install/channel: latest release
- Active plugins: No user-configured plugins; crash occurs in the built-in
opencode.btw plugin
Reproduction
- Open an existing session in the TUI.
- Enter
/btw <question>.
- Wait for the generated answer.
The issue reproduces consistently.
Expected Behavior
The generated answer should appear in the /btw dialog without modifying the session history.
Actual Behavior
The TUI displays its crash screen with:
Error: PluginProvider is missing
The stack trace originates from Answer in the built-in /btw plugin.
Additional Context
The issue has been reproduced with a fixture-driven TUI test that invokes /btw, returns a generated answer, and observes the same crash screen.
The cause appears to be a provider-boundary mismatch:
PluginProvider is mounted beneath DialogProvider.
DialogProvider renders dialog elements alongside its children, outside the child PluginProvider subtree.
- The
/btw Answer component calls the host TUI's usePlugin() hook to obtain markdown renderers.
- Consequently, rendering the answer dialog throws
PluginProvider is missing.
A narrow fix is to read the markdown renderer while the plugin's app slot is mounted beneath PluginProvider, then pass that renderer into the answer dialog rather than calling usePlugin() inside the dialog.
Stop letting @thdxr push :)
Summary
Running the built-in
/btwslash command crashes the TUI after the generated answer is returned. The answer dialog attempts to accessPluginProvideroutside its context boundary.Environment
TERM=xterm-ghostty,COLORTERM=truecolor)/bin/zshopencode.btwpluginReproduction
/btw <question>.The issue reproduces consistently.
Expected Behavior
The generated answer should appear in the
/btwdialog without modifying the session history.Actual Behavior
The TUI displays its crash screen with:
The stack trace originates from
Answerin the built-in/btwplugin.Additional Context
The issue has been reproduced with a fixture-driven TUI test that invokes
/btw, returns a generated answer, and observes the same crash screen.The cause appears to be a provider-boundary mismatch:
PluginProvideris mounted beneathDialogProvider.DialogProviderrenders dialog elements alongside its children, outside the childPluginProvidersubtree./btwAnswercomponent calls the host TUI'susePlugin()hook to obtain markdown renderers.PluginProvider is missing.A narrow fix is to read the markdown renderer while the plugin's app slot is mounted beneath
PluginProvider, then pass that renderer into the answer dialog rather than callingusePlugin()inside the dialog.