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 at "Starting background server..." when Desktop app is installed #57978
When both the OpenCode Desktop app and TUI are installed, the TUI cannot start its background service if the Desktop app has been launched before. opencode service status reports stopped. After closing the Desktop app and killing the service process, starting from the TUI hangs indefinitely at:
opencode
Starting background server...
If the Desktop app is then started again, the TUI immediately reports an error mentioning:
49374 on 0.0.0.0 is already ...
However, before restarting the Desktop app, port 49374 should be free, so the TUI should be able to start the background server immediately. Instead, it hangs indefinitely.
Manually running opencode serve --service starts normally. This suggests the issue is specific to how the single opencode command launches opencode serve --service, rather than the service command itself.
Environment
OpenCode version: 2.1.2
Installation: Desktop app + TUI both installed
OS: ubuntu24.04 amd
Shell: bash
Desktop app version: 2.1.2
Steps to Reproduce
Expected Behavior
If port 49374 is free, the TUI should start the background server successfully.
If the port is occupied, the TUI should fail fast with a clear error instead of hanging indefinitely.
opencode service status should reflect the actual service state.
Starting the TUI should behave consistently with manually running opencode serve --service.
Plugins
None
OpenCode version
2.1.2
Steps to reproduce
Install both OpenCode Desktop and OpenCode TUI.
Start the Desktop app.
Try to start the TUI.
Observe that the TUI cannot start.
Run opencode service status; it reports stopped.
Close the Desktop app and kill the related service process.
Confirm that port 49374 is free, e.g.:
lsof -i :49374
Start OpenCode from the TUI.
Observe that it hangs indefinitely at:
opencode
Starting background server...
While the TUI is still hanging, start the Desktop app again.
Observe that the TUI immediately reports an error similar to:
changed the title [-]TUI hangs indefinitely at “Starting background server...” when Desktop and TUI are both installed; manual opencode serve --service works[/-][+]TUI hangs at "Starting background server..." when Desktop app is installed[/+]on Oct 22, 2026
Thanks for the detailed report. I tried to reproduce this with the 2.1.2 CLI on Linux, but I couldn't run the Desktop app here, and that seems to be what triggers it. Without Desktop, the TUI started the background server normally every time I tried, including:
with hostname set to 0.0.0.0 in the service config (the address in your error)
after force-killing the service process and leaving its registration file behind
So this needs a maintainer who can run Desktop 2.1.2 on Linux. These would help them track it down:
The output of opencode service get, and the contents of ~/.config/opencode/service.json and ~/.local/state/opencode/service.json after you have launched the Desktop app (please remove the password value).
While the TUI is hanging: the output of ps aux | grep opencode, and the most recent entries from ~/.local/share/opencode/log/opencode.log around that time.
Whether running opencode service start in that same state also hangs or prints an error.
Activity
[-]TUI hangs indefinitely at “Starting background server...” when Desktop and TUI are both installed; manual opencode serve --service works[/-][+]TUI hangs at "Starting background server..." when Desktop app is installed[/+]opencode-agent commentedon Oct 22, 2026
Thanks for the detailed report. I tried to reproduce this with the 2.1.2 CLI on Linux, but I couldn't run the Desktop app here, and that seems to be what triggers it. Without Desktop, the TUI started the background server normally every time I tried, including:
hostnameset to0.0.0.0in the service config (the address in your error)So this needs a maintainer who can run Desktop 2.1.2 on Linux. These would help them track it down:
opencode service get, and the contents of~/.config/opencode/service.jsonand~/.local/state/opencode/service.jsonafter you have launched the Desktop app (please remove thepasswordvalue).ps aux | grep opencode, and the most recent entries from~/.local/share/opencode/log/opencode.logaround that time.opencode service startin that same state also hangs or prints an error.Closely related issues, most likely first:
service statussaysstoppedeven though a service is running, because it was registered under a different state directoryWangZhongDian commentedon Oct 22, 2026
Can the desktop and TUI not share the same backend service?