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: plugin EPIPE unhandled rejection kills the client silently (no diagnostic) #54575
A plugin write that fails with EPIPE (the pipe to the parent was closed) produces an unhandled Promise rejection that terminates the opencode TUI client silently — the process exits with no error surfaced in the TUI. Plugin failures present as random, unexplained client crashes.
Active plugins: opentmux (local), opencode-plugin-litellm@latest, a local herdr TUI plugin (v1-era @opencode-ai/plugin API at the time of the crash)
Reproduction
Install a plugin whose code writes to a file descriptor that has been closed by the parent (observed: a v1-era TUI plugin writing during client startup when the parent had already closed the pipe).
Start opencode.
The client exits immediately, with no error shown in the TUI.
Expected Behavior
A failing plugin write is surfaced as a plugin error — e.g. a "failed to load plugin" message, a logged non-fatal error, or at minimum an actionable exit diagnostic. An unhandled rejection in plugin code should not take down the whole client silently.
Actual Behavior
The EPIPE write throws; the rejection is unhandled; the opencode client process dies silently. No error is visible to the user — it looks like an unexplained crash at startup.
Additional Context
Triggered during an opencode v1→v2 migration (2026-10): the offending plugin used the old @opencode-ai/plugin API and wrote during load; under opencode 2.0.25 it hit EPIPE and killed the client.
Local workaround that resolved it: port the plugin to the v2 @opencode/plugin API and wrap writes in try/catch with error/close handlers.
Suggestion: a process-level unhandledRejection handler in the TUI that logs the rejection (ideally with plugin context) and keeps the client alive, or exits with a clear diagnostic instead of dying silently.
Thanks for the detailed report! Before we can try to reproduce this, could you share a bit more?
The error itself. You mention EPIPE and an unhandled rejection. Where did you see them? Please paste the full error and stack trace, plus the relevant lines from the OpenCode log for that run (~/.local/share/opencode/log/).
A minimal reproducing plugin. A short snippet of the plugin code that did the failing write: which stream or file descriptor it wrote to (stdout/stderr, a socket, a child process pipe, …), and where in the plugin it ran (at load time, in a hook, …). If you can, please also check whether it still happens with a plain v2 plugin that does the same write without your try/catch.
How the plugin was loaded. Was it listed under plugin in opencode.json or tui.json, or loaded from .opencode/plugin(s)/? And which command did you run: plain opencode, or something like opencode run/attach?
For context: the v2 CLI already installs handlers for unhandled rejections and uncaught exceptions that log the error instead of crashing, and it ignores EPIPE on stdout. So the exact error and stack would help us find where the failure really escapes.
You can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it so we know you're done.
These issues look related (ordered by likelihood), though none seems to be exactly the same problem:
We're closing this for now, since we haven't heard back and can't reproduce the crash without more detail. In particular, we'd need the actual EPIPE error and stack trace (or the log lines from ~/.local/share/opencode/log/) and a minimal plugin snippet that triggers it. The v2 CLI already logs unhandled rejections instead of crashing, so those details are what would show where this one gets through.
If it happens again on a current v2 release, please comment here with that information, or open a new issue that links back to this one, and we'll take another look. Thanks for reporting it!
Activity
opencode-agent commentedon Oct 11, 2026
Thanks for the detailed report! Before we can try to reproduce this, could you share a bit more?
~/.local/share/opencode/log/).plugininopencode.jsonortui.json, or loaded from.opencode/plugin(s)/? And which command did you run: plainopencode, or something likeopencode run/attach?For context: the v2 CLI already installs handlers for unhandled rejections and uncaught exceptions that log the error instead of crashing, and it ignores EPIPE on stdout. So the exact error and stack would help us find where the failure really escapes.
You can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it so we know you're done.
These issues look related (ordered by likelihood), though none seems to be exactly the same problem:
uncaughtExceptionhandler calledprocess.exit(1)opencode-agent commentedon Oct 14, 2026
We're closing this for now, since we haven't heard back and can't reproduce the crash without more detail. In particular, we'd need the actual EPIPE error and stack trace (or the log lines from
~/.local/share/opencode/log/) and a minimal plugin snippet that triggers it. The v2 CLI already logs unhandled rejections instead of crashing, so those details are what would show where this one gets through.If it happens again on a current v2 release, please comment here with that information, or open a new issue that links back to this one, and we'll take another look. Thanks for reporting it!