anomalyco / anomalyco/opencode
Desktop app: Sidecar dies silently after 1-4 minutes, causing no response to messages
@Hona is already working on this.
Since Aug 23, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Desktop app: Sidecar dies silently after 1-4 minutes, causing no response to messages
Description
The OpenCode Desktop app (Electron) on Windows starts correctly but the sidecar process exits silently within 1-4 minutes of startup. After this happens, any message sent from the renderer gets no response because the server is no longer running. The terminal and antigravity versions work perfectly since they don't use the sidecar architecture.
Steps to Reproduce
- Open OpenCode Desktop app
- Wait 1-4 minutes
- Type any message (e.g., "hola")
- No response is received
Expected Behavior
The sidecar should stay alive for the duration of the session, or automatically restart if it crashes.
Actual Behavior
The sidecar exits with code 0 (clean exit, not a crash) and is never restarted. The renderer loses its SSE connection and all subsequent requests fail silently.
Evidence
Sidecar exit pattern (all sessions from today):
| Session | Start | Sidecar Exit | Time Alive |
|---|---|---|---|
| 20260823T142903 | 10:29:03 | 10:31:30 | ~2 min |
| 20260823T142435 | 10:24:35 | 10:28:58 | ~4 min |
| 20260823T141119 | 10:11:20 | 10:13:21 | ~2 min |
| 20260823T140942 | 10:09:42 | 10:09:44 | <1 min |
| 20260823T001753 | 20:17:53 | 20:19:26 | ~1.5 min |
| 20260823T001410 | 20:14:13 | 20:17:47 | ~3.5 min |
utility.log entry (consistent across all sessions):
[warn] (utility) sidecar exited { code: 0 }
main.log shows normal startup every time:
[info] sidecar connection started { version: 'v1' }
[info] spawning sidecar { url: 'http://127.0.0.1:XXXXX' }
[info] server ready { url: 'http://127.0.0.1:XXXXX' }
// ... then nothing after this, sidecar dies silently
Crash dump present:
bf0ed3e9-6d0c-4a80-a906-b5fb6593b53e.dmp— 33MB, dated 2026-08-10
Renderer log errors (in sessions that lasted longer):
[error] ResizeObserver loop completed with undelivered notifications.
(Dozens of these per session)
Environment
- OS: Windows 10 Home (64-bit), version 2009
- CPU: 12th Gen Intel Core i9-12900H
- OpenCode Desktop version: 1.18.21 (packaged)
- Install path:
C:\Users\joseh\AppData\Local\Programs\@opencode-aidesktop
Additional Context
- The terminal version (
opencodeCLI) works perfectly — no sidecar involved - The antigravity version also works fine
- The issue is specific to the Electron desktop app's sidecar management
- The sidecar process exits with code 0, suggesting a clean shutdown rather than a crash
- No automatic restart mechanism exists for the sidecar
Possible Root Causes
- SSE heartbeat timeout: The 10-second heartbeat may be missed by Electron's utility process scheduler on Windows, causing the server to close the connection
- Port allocation race condition (TOCTOU): The dynamic port is freed by
socket.close()before the sidecar binds to it - Provider bootstrap failure: v1.18.5+ regression where provider/model/MCP fail to load silently
Suggested Fixes
- Add automatic sidecar restart with exponential backoff on unexpected exit
- Add a health check timeout (current
ready()loop has no max retry) - Fix the SSE heartbeat timing for Windows Electron environment
- Add renderer-side reconnection logic when SSE drops
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.