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
Desktop sidecar repeatedly crashes with V8 out-of-memory, causing local server red and Failed to fetch #41964
The desktop app frequently shows Failed to fetch. At the same time, the local server indicator at the top turns red. Opening a new conversation does not help because all conversations share the same local sidecar.
Reproduction
Start OpenCode desktop.
Use one or several conversations.
After several requests or new conversations, the local server indicator turns red.
Sending a message fails with Failed to fetch.
Logs
The sidecar repeatedly crashes with:
OOM error in V8: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
Observed at approximately:
2026-08-12 13:44
2026-08-12 13:57
2026-08-12 13:59
2026-08-12 14:10
After the sidecar exits, the renderer reports:
TypeError: Failed to fetch
Restarting the entire OpenCode process temporarily recovers the app. Creating a new conversation does not.
Relevant log directory:
%APPDATA%\ai.opencode.desktop\logs
No account credentials, API keys, or subscription URLs are included.
If your issue is distinct (e.g. triggered under different conditions or with a different root cause), please add details that distinguish it from the above.
Source-level root cause: Electron locks the sidecar V8 heap at ~2GB, and NODE_OPTIONS is stripped in packaged apps
Same crash here on v1.18.19 / macOS arm64 / Electron 42.3.3. I dug into the Electron + opencode source and found why the heap can never be raised past ~2.5GB, which means this will keep crashing as long as the working set touches the limit.
Evidence 1: utilityProcess.fork has no resourceLimits, and opencode passes empty args
Electron's electron_api_utility_process.cc:555-599 only accepts args / env / execArgv / serviceName / cwd / stdio / session / partition — no resourceLimits option exists for utilityProcess.fork.
Evidence 2: NODE_OPTIONS is whitelist-filtered in packaged apps
Electron node_bindings.cc:456-517 (SetNodeOptions): when is_packaged_app is true, only --http-parser and --max-http-header-size are allowed; everything else (including --max-old-space-size) is silently dropped:
if (is_packaged_app && !pkg_opts.contains(option)) {
// Explicitly disallow majority of NODE_OPTIONS in packaged appsLOG(ERROR) << "Most NODE_OPTIONs are not supported in packaged apps.";
continue;
}
Result: launchctl setenv NODE_OPTIONS "--max-old-space-size=8192" has no effect on the sidecar. The heap stays at the default 2048MB old space (~2518MB total).
Evidence 3: the GC trace numbers were misread
Crash log 2435.0 (2518.3) is used(limit), not used -> new_limit. The limit never moved; 2435MB is just how much was in use when it died.
Why CLI works but Desktop crashes
Same workload runs at ~1.7GB heap in both, but the CLI (plain Node) has a ~4GB heap limit on this machine (and NODE_OPTIONS works there), while the sidecar's is locked at ~2.5GB. Same 1.7GB = 41% on CLI, 68% on Desktop — any burst (streaming updates, file diffs, subagents) tips it over.
Suggested fix (for maintainers)
Give the sidecar an explicit heap headroom — e.g. pass execArgv: ["--max-old-space-size=8192"] to utilityProcess.fork, or bundle the CLI binary and run the server as a detached child process (v2 mode) instead of a node.mojom.NodeService utility process.
Or add a memory budget / lazy eviction for part data in the server so the working set stays bounded.
Happy to upload a heap snapshot per the Memory Megathread instructions if that helps.
OOM error in V8: Zone Allocation failed - process out of memory
The utility log then reported sidecar exited { code: 0 }.
About six minutes later the renderer reported TypeError: Failed to fetch.
A Crashpad minidump identifies the failing process as Electron's node.mojom.NodeService utility process. It did not provide a useful native stack.
The workload involved two concurrent long-running sessions, one reaching 137 agent steps, and repeated Chrome DevTools performance trace and analysis calls. This is a possible memory-pressure contributor, not a confirmed root cause. The pending operation immediately before OOM only evaluated permissions for several .json.gz edit targets; no file I/O was recorded.
No dump or raw debug archive is attached because it contains process environment data. All paths, session identifiers, port numbers, credentials, and project-specific names have been omitted. A sanitized dump metadata extract or a targeted reproduction can be provided if useful.
Updating with missing reproduction details that got mangled:
macOS version: 15.7.3 arm64 OpenCode: 1.18.31 (both CLI via Homebrew and .app bundle) Node.js: v22.13.1
Sidecar OOM log:
[19423:0917/062532.266543:ERROR:electron/shell/common/node_bindings.cc:189] OOM error in V8: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.
Activity
github-actions commentedon Aug 12, 2026
This issue might be a duplicate of existing issues. Please check:
message.updated.1causes OOM when loading old sessionsIf your issue is distinct (e.g. triggered under different conditions or with a different root cause), please add details that distinguish it from the above.
edynasty commentedon Aug 21, 2026
Source-level root cause: Electron locks the sidecar V8 heap at ~2GB, and NODE_OPTIONS is stripped in packaged apps
Same crash here on v1.18.19 / macOS arm64 / Electron 42.3.3. I dug into the Electron + opencode source and found why the heap can never be raised past ~2.5GB, which means this will keep crashing as long as the working set touches the limit.
Evidence 1:
utilityProcess.forkhas noresourceLimits, and opencode passes emptyargspackages/desktop/src/main/server.ts:63-69:electron_api_utility_process.cc:555-599only acceptsargs / env / execArgv / serviceName / cwd / stdio / session / partition— noresourceLimitsoption exists forutilityProcess.fork.Evidence 2:
NODE_OPTIONSis whitelist-filtered in packaged appsnode_bindings.cc:456-517(SetNodeOptions): whenis_packaged_appis true, only--http-parserand--max-http-header-sizeare allowed; everything else (including--max-old-space-size) is silently dropped:launchctl setenv NODE_OPTIONS "--max-old-space-size=8192"has no effect on the sidecar. The heap stays at the default 2048MB old space (~2518MB total).Evidence 3: the GC trace numbers were misread
Crash log
2435.0 (2518.3)isused(limit), notused -> new_limit. The limit never moved; 2435MB is just how much was in use when it died.Why CLI works but Desktop crashes
Same workload runs at ~1.7GB heap in both, but the CLI (plain Node) has a ~4GB heap limit on this machine (and
NODE_OPTIONSworks there), while the sidecar's is locked at ~2.5GB. Same 1.7GB = 41% on CLI, 68% on Desktop — any burst (streaming updates, file diffs, subagents) tips it over.Suggested fix (for maintainers)
execArgv: ["--max-old-space-size=8192"]toutilityProcess.fork, or bundle the CLI binary and run the server as a detached child process (v2 mode) instead of anode.mojom.NodeServiceutility process.Happy to upload a heap snapshot per the Memory Megathread instructions if that helps.
byJming commentedon Sep 8, 2026
Additional sanitized reproduction data for the same symptom chain:
The workload involved two concurrent long-running sessions, one reaching 137 agent steps, and repeated Chrome DevTools performance trace and analysis calls. This is a possible memory-pressure contributor, not a confirmed root cause. The pending operation immediately before OOM only evaluated permissions for several .json.gz edit targets; no file I/O was recorded.
No dump or raw debug archive is attached because it contains process environment data. All paths, session identifiers, port numbers, credentials, and project-specific names have been omitted. A sanitized dump metadata extract or a targeted reproduction can be provided if useful.
imvenkata commentedon Sep 17, 2026
Same crash confirmed on macOS arm64 (v1.18.31)
Can confirm this affects macOS arm64 / OpenCode 1.18.31 as well. The sidecar OOMs consistently ~50s after launch regardless of environment.
Reproduction
What we tried (none helped)
Logs
Sidecar consistently exits with code 5 (SIGABRT from OOM):
GPU process + crashpad follow after sidecar termination:
Workaround
CLI works fine:
opencode run "your question"The raw Node.js process (CLI) has the default ~4GB heap, so the same workload fits. Only Electron's child hits the ~2.5GB wall.
Root cause alignment
Matches @edynasty's analysis from the comments above — the fix needs to come from the maintainers by either:
execArgv: ["--max-old-space-size=8192"]inutilityProcess.forkcall inpackages/desktop/src/main/server.tsHappy to provide additional logs or details.
imvenkata commentedon Sep 17, 2026
Updating with missing reproduction details that got mangled:
macOS version: 15.7.3 arm64
OpenCode: 1.18.31 (both CLI via Homebrew and .app bundle)
Node.js: v22.13.1
Sidecar OOM log:
GPU + crashpad follow:
The table rows that got eaten were:
NODE_OPTIONS=...→ rejected by Electron--js-flags=...→ does not propagate to utilityProcess.fork childAlready tracking this issue. Happy to test patches if needed.
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊