Description
Description
After restarting the desktop app, models/tools stay empty for ~5.5 minutes before the UI becomes usable.
The app's main process repeatedly starts/probes the background service and always gets probed: false, while the renderer's event stream (SSE) disconnects every ~3 seconds. The loop runs ~110 times (~5.5 min) and then stops, after which the app works normally.
This is not the engine/server: a standalone opencode run --standalone reaches mcp connected in ~1.4 s and opencode models returns in ~0.2 s. The background server was already running (started earlier); only the app <-> service connection failed.
Evidence (sanitized, Windows desktop 2.0.20, single launch)
main.log:
[12:00:40.174] (main) starting v2 background service
[12:00:40.175] (main) v2 CLI background service ready { version: '2.0.20', probed: true, url: 'http://127.0.0.1:49374', port: '49374' }
[12:00:42.255] (main) starting v2 background service
[12:00:42.261] (main) v2 CLI background service ready { probed: false, url: 'http://127.0.0.1:49374', port: '49374' }
... repeated every ~3 s ...
[12:06:15.325] (main) starting v2 background service
[12:06:15.329] (main) v2 CLI background service ready { probed: false, url: 'http://127.0.0.1:49374', port: '49374' }
Counts for that run: 111 x starting v2 background service, 110 x probed: false, 1 x probed: true (only the very first probe right after launch succeeded).
renderer.log:
[12:00:42.253] [global-sdk] event stream disconnected [object Object]
[12:00:44.266] [global-sdk] event stream disconnected [object Object]
... every ~3 s ...
[12:06:15.324] [global-sdk] event stream disconnected [object Object] <- last (110 total)
The background service URL/port stays constant (127.0.0.1:49374), yet the probe keeps reporting false.
Steps to reproduce
- On Windows, launch/restart the OpenCode desktop app (2.0.20) while a background service is already running (e.g. restart the app window without stopping the service).
- Observe models/tools stay empty for several minutes.
- Inspect
%APPDATA%\ai.opencode.desktop\logs\<run>\main.log(repeatedstarting v2 background service/probed: false) andrenderer.log(event stream disconnectedevery ~3 s).
Expected
The app connects to the background service within seconds after launch and models/tools become available immediately.
Actual
~5.5 minutes of ~3-second retries (110 attempts) before the app recovers on its own.
Notes
- Restarting the app window does not restart the long-running background service; the retry storm happens against an already-running service.
opencode service statusreportshttp://127.0.0.1:49374.- Full sanitized
main.log/renderer.logavailable on request.
Plugins
None.
OpenCode version
2.0.20 (desktop)
Operating System
Windows 10 Pro 22H2 (10.0.19045), x64
Terminal
Desktop app (Electron); not terminal-specific.
Activity
github-actions commentedon Sep 30, 2026
This issue might be a duplicate of existing issues. Please check:
opencodejr commentedon Oct 28, 2026
Thanks for the detailed logs. I couldn't reproduce this here: it needs the desktop app on Windows, and this sandbox is Linux-only.
What I could check: with
@opencode/[email protected]on Linux, a background service started withopencode service start(it came up on127.0.0.1:49374) kept the event stream open with regular heartbeats and didn't disconnect. Theprobed: falselines look expected: the desktop app only runs the early probe on its first connect, and every later reconnect logsprobed: false. Each of those reconnects starts because the event stream dropped. So the real question is why the stream disconnects every ~3 s on your machine.These would help a maintainer with a Windows setup:
renderer.logshows it only as[object Object]. If you open DevTools in the desktop app during the slow window, the console entry[global-sdk] event stream disconnectedshould show anerrorfield with the real message.127.0.0.1(antivirus or firewall software, a proxy, VPN), and whethercurl -N -u opencode:<password> http://127.0.0.1:49374/api/eventstays connected during that window. The password is in the service'sservice.json; please don't post it here.A maintainer with a Windows environment will need to look at this.