anomalyco / anomalyco/opencode

Desktop app: Sidecar dies silently after 1-4 minutes, causing no response to messages

Open
#44,475 1 comment 0 reactions 1 assignee View on GitHub

@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

  1. Open OpenCode Desktop app
  2. Wait 1-4 minutes
  3. Type any message (e.g., "hola")
  4. 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 (opencode CLI) 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

  1. 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
  2. Port allocation race condition (TOCTOU): The dynamic port is freed by socket.close() before the sidecar binds to it
  3. Provider bootstrap failure: v1.18.5+ regression where provider/model/MCP fail to load silently

Suggested Fixes

  1. Add automatic sidecar restart with exponential backoff on unexpected exit
  2. Add a health check timeout (current ready() loop has no max retry)
  3. Fix the SSE heartbeat timing for Windows Electron environment
  4. Add renderer-side reconnection logic when SSE drops

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.