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 hangs on a blank screen when --port is already in use #54934
opencode --port 4096 with port 4096 already in use never starts and never says why: the terminal stays blank until you kill opencode.
The TUI asks its server worker to start the listener over the internal RPC channel (packages/opencode/src/util/rpc.ts). Server.listen rejects, but Rpc.listen posts a reply only when the method returns, and the worker swallows the rejection, so the TUI waits for that reply forever. Any other worker request whose handler throws hangs the TUI the same way.
Thanks for the detailed report and root-cause analysis, @Nowaker.
This is in OpenCode v1 (1.19.0), which now only gets fixes for critical bugs: data loss, security problems, or breakage with no workaround. This hang can be avoided by freeing the port or choosing a different --port, so it's unlikely to be fixed in v1.
We'd encourage you to try v2 (@opencode/cli). It's a separate implementation in which the CLI starts a managed service, and that service checks for EADDRINUSE and reports that the port is already in use. In case they're useful, these v2 issues are related:
We haven't heard back, so I'm closing this as not planned. The hang when --port is already in use is in OpenCode v1 (1.19.0), which only gets critical fixes. Freeing the port or choosing a different --port avoids it. v2 (@opencode/cli) handles a port that's already in use differently and reports an error. If you can reproduce this on v2, please open a new issue or reply here with the details. Thanks for the thorough report, @Nowaker.
Activity
opencode-agent commentedon Oct 12, 2026
Thanks for the detailed report and root-cause analysis, @Nowaker.
This is in OpenCode v1 (1.19.0), which now only gets fixes for critical bugs: data loss, security problems, or breakage with no workaround. This hang can be avoided by freeing the port or choosing a different
--port, so it's unlikely to be fixed in v1.We'd encourage you to try v2 (
@opencode/cli). It's a separate implementation in which the CLI starts a managed service, and that service checks forEADDRINUSEand reports that the port is already in use. In case they're useful, these v2 issues are related:opencode serveshows "Unexpected error" with no details when startup fails #48784:opencode servefailing to start without giving detailsIf you think this is critical, or you can reproduce it on v2, please reply here with the details.
docs(forklog): record the -s hang fix for a locked database at startup
opencode-agent commentedon Oct 13, 2026
We haven't heard back, so I'm closing this as not planned. The hang when
--portis already in use is in OpenCode v1 (1.19.0), which only gets critical fixes. Freeing the port or choosing a different--portavoids it. v2 (@opencode/cli) handles a port that's already in use differently and reports an error. If you can reproduce this on v2, please open a new issue or reply here with the details. Thanks for the thorough report, @Nowaker.