You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tui: /btw crashes when rendering answer dialog #49777
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.
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 /btwAnswer 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.
Reacted by MoonVoid, Dan Smolsky and Miron Sadykov
Active plugins: one local plugin (opencode2-quota); the crash occurs in the built-in opencode.btw plugin, not the user plugin
Reproduction
Open an existing session in the TUI.
Run /btw <question>.
Once the generated answer returns, the TUI shows the crash screen.
Reproduces every time — not intermittent.
Actual behavior
Error: PluginProvider is missing
at sc (/$bunfs/root/chunk-78sbr86b.js:2593:2804)
at Qc (/$bunfs/root/chunk-3y6z3143.js:4:248)
at Xn (/$bunfs/root/chunk-p4ydqyaa.js:2:7348)
at children (/$bunfs/root/chunk-78sbr86b.js:2590:118420)
...
The top frame is at chunk-78sbr86b.js:2593:2804, which matches the offset in #49790 (chunk-vbstx86m.js:2593:2804) — only the build hash differs. So this is the same usePlugin()-outside-PluginProvider path as described here. The root-cause analysis above (PluginProvider mounted beneath DialogProvider, while dialogs render outside the child subtree) is consistent with what we see.
Same crash on Windows, confirming cross-platform repro: opencode 2.0.8, Windows 10.0.26200 (x64), WarpTerminal. Ran /btw while the agent was still working, TUI crashed with Error: PluginProvider is missing. Stack matches offset-for-offset (chunk-qp8tk0rb.js:2593:2804), only the chunk hash differs by platform, same as #49790.
One more environment data point, plus a root-cause detail that may be useful for the fix.
New repro not yet covered here: Linux x64, and zero plugins configured.
opencode version: 2.0.8
OS: Linux 6.6.141-09476-g954adab60416 (linux x64)
Terminal: TERM=xterm-256color, no COLORTERM / TERM_PROGRAM
Shell: /bin/bash
Install/channel: latest release
Active plugins: none — no plugin key in opencode.jsonc, no .opencode/plugin(s)/ directory
The existing confirmations in this thread (macOS x2, Windows) either had a local plugin installed or didn't state plugin state. This reproduces with an empty plugin configuration, which confirms the failure is entirely independent of user plugins — PluginProvider is internal to opencode.
The stack matches offset-for-offset (chunk-vbstx86m.js:2593:2804, caller chunk-x0cbprj9.js:4:248), only the chunk hash differing.
One detail from the bundle that may be relevant to the fix. The accessor is called unconditionally at the top of the /btw dialog component body, not inside a lazy computation:
// throw sitefunctionsa(){lett=Xn(ZW);if(!t)throwError("PluginProvider is missing");returnt}// caller — /btw answer dialogfunctionUc(t){letr=Je(),o=Vt(),i=QH(),u=sa(),l=He("elevated"),m=He("overlay"),...
Because the read happens during component setup, it throws on render regardless of whether any plugin is installed. There are 11 call sites of this accessor across the TUI bundle, so any of them rendered outside the provider would fail identically — the fix may want to check the full set rather than just the /btw dialog.
(Confirmed already fixed in 2.0.9 per the closing note — posting only to add the Linux / no-plugin coverage.)
Activity
cestercian commentedon Sep 18, 2026
Looking into this — planning to fix the /btw answer dialog so it renders inside PluginProvider (or otherwise avoids the out-of-context access).
patrickzxk commentedon Sep 18, 2026
Confirming the same crash on a different environment (macOS), for extra coverage.
Environment
TERM=xterm-256color,COLORTERM=truecolor)opencode2-quota); the crash occurs in the built-inopencode.btwplugin, not the user pluginReproduction
/btw <question>.Reproduces every time — not intermittent.
Actual behavior
The top frame is at
chunk-78sbr86b.js:2593:2804, which matches the offset in #49790 (chunk-vbstx86m.js:2593:2804) — only the build hash differs. So this is the sameusePlugin()-outside-PluginProviderpath as described here. The root-cause analysis above (PluginProvider mounted beneath DialogProvider, while dialogs render outside the child subtree) is consistent with what we see.kyeshmz commentedon Sep 18, 2026
Confimred with Wezterm as welll on macOs latest and opencode 2.0.8
Asura7170 commentedon Sep 19, 2026
Same crash on Windows, confirming cross-platform repro: opencode 2.0.8, Windows 10.0.26200 (x64), WarpTerminal. Ran /btw while the agent was still working, TUI crashed with Error: PluginProvider is missing. Stack matches offset-for-offset (chunk-qp8tk0rb.js:2593:2804), only the chunk hash differs by platform, same as #49790.
stevoland commentedon Sep 19, 2026
Fixed in 2.0.9 thx
brettanthonysjoberg179-lab commentedon Sep 27, 2026
One more environment data point, plus a root-cause detail that may be useful for the fix.
New repro not yet covered here: Linux x64, and zero plugins configured.
TERM=xterm-256color, noCOLORTERM/TERM_PROGRAM/bin/bashpluginkey inopencode.jsonc, no.opencode/plugin(s)/directoryThe existing confirmations in this thread (macOS x2, Windows) either had a local plugin installed or didn't state plugin state. This reproduces with an empty plugin configuration, which confirms the failure is entirely independent of user plugins —
PluginProvideris internal to opencode.The stack matches offset-for-offset (
chunk-vbstx86m.js:2593:2804, callerchunk-x0cbprj9.js:4:248), only the chunk hash differing.One detail from the bundle that may be relevant to the fix. The accessor is called unconditionally at the top of the
/btwdialog component body, not inside a lazy computation:Because the read happens during component setup, it throws on render regardless of whether any plugin is installed. There are 11 call sites of this accessor across the TUI bundle, so any of them rendered outside the provider would fail identically — the fix may want to check the full set rather than just the
/btwdialog.(Confirmed already fixed in 2.0.9 per the closing note — posting only to add the Linux / no-plugin coverage.)