Skip to content

desktop: OpenCode.exe crashes on relaunch after close (0x80000003 during background-service startup) #50817

Open

Description

@zengyilt

Summary

OpenCode desktop crashes on every relaunch after closing the window (X). First launch after reboot works; any later launch flashes and dies ~1s after logging starting v2 background service. Affects 2.0.12 and 2.0.14.

Environment

  • opencode version: v2.0.14 (also reproduced on 2.0.12 before auto-update)
  • OS: Microsoft Windows [Version 10.0.26200.9457] (win32 x64)
  • Terminal: TERM=xterm-256color; TERM_PROGRAM/COLORTERM unset
  • Shell: COMSPEC=C:\WINDOWS\system32\cmd.exe (diagnostics run via pwsh 7)
  • Install/channel: desktop release, updater channel latest, packaged=true
  • Active plugins: none (no plugin entries in config; custom local model provider configured, details omitted)

Reproduction

  1. Launch OpenCode desktop (first launch after reboot works).
  2. Close the window via the X button (no tray icon remains; no OpenCode.exe in Task Manager).
  3. Launch OpenCode desktop again.
  4. Window flashes, then the process exits. Windows logs Application Error 1000.

Expected Behavior

The app window reopens and reconnects to (or restarts) the background service.

Actual Behavior

The new process crashes ~1s after starting v2 background service, before background service ready, with no renderer.log. Windows Event Viewer, Application Error 1000:

  • 2.0.14.0: Faulting module OpenCode.exe, Exception 0x80000003, Fault offset 0x735ae59 (11:28:38, 11:28:20, 11:28:09, 11:09:35, 11:03:52, 11:00:12, 10:56:22, 10:53:43, 10:48:18, ...)
  • 2.0.12.0: Exception 0x80000003, Fault offset 0x6e90e29 (10:27:01, 10:24:50, 10:24:12, ...)

Failing launch main.log tail (20260923T030934):

[info] (main) main window visible {...}
[info] (main) updater state changed { from: 'idle', to: 'checking' }
[info] (main) Checking for update
[info] (main) starting v2 background service
<process crashes here; no `background service ready`, no renderer.log>

Successful launch (20260923T031524) continues past this point: update check -> up-to-date -> v2 CLI background service starting { reason: 'missing' } -> ready { url: 'http://127.0.0.1:49374' }.

Update: 3 more crashes at 11:28:09/20/38 reached v2 CLI background service ready { probed: true, url: 'http://127.0.0.1:49374' } before crashing, so the crash is after connecting to the background service in that path too.

Additional Context

  • Frequency: consistent; ~8 failed launches in ~22 min, plus failures yesterday evening.
  • Recent change: auto-update 2.0.12 -> 2.0.14 (differential download fell back to full download); crash signature persists across both versions at different offsets.
  • Ruled out: stale zombie processes (none in Task Manager after close), off-screen window (window-state x:200 y:74 within 1536x960), crash dumps (Crashpad/reports has no new dumps; only Event 1000).
  • server opencode.log shows only benign worktree discovery failed (DirectoryUnavailableError) for a non-git directory and one models.opencode.ai ENOTFOUND.
  • Workaround: rebooting works. Killing processes does not apply (none remain). service restart + service status via staged CLI did not help.

Activity

  1. github-actions commented on Sep 23, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for the detailed report, with the event log entries and the main.log tails from a failing and a successful launch.

    This crash happens inside the Windows desktop app (OpenCode.exe crashing with exception 0x80000003 while connecting to the background service). Our automated environment can't run that, so a maintainer with a Windows machine will need to reproduce it.

    In the meantime, it would help to know:

    • Does it still happen on the latest desktop release (2.2.0)? Electron was upgraded and the background-service code has changed since 2.0.14.
    • After closing the window, is an opencode process (the background service, opencode serve --service) still running in Task Manager's Details tab? OpenCode.exe itself may be gone while the service stays up.
    • If one is, does ending only that process before relaunching avoid the crash?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions