Skip to content

opencode-auto-exit #26149

Closed as not planned
Closed as not planned

Description

@dunlingzi

Description

Describe the bug

OpenCode Desktop automatically exits (clean shutdown, exit code 0) immediately after a session conversation completes. The user does not manually close the window — the Desktop window disappears on its own as soon as the AI finishes responding.

Regression window: Between v1.14.33 (working) and v1.14.35 (affected). v1.14.34 was not tested. The last known-good version is v1.14.33. All tested versions from v1.14.35 through v1.14.40 are affected.

Environment

  • Platform: Windows 11 (x64)
  • OpenCode Desktop versions tested: v1.14.33 (working), v1.14.35 / v1.14.37 / v1.14.39 / v1.14.40 (all affected)
  • Shell: cmd
  • Installation path: D:\OpenCode\OpenCode.exe
  • Launch method: Direct double-click (also reproduced via debug batch with Electron crash diagnostics enabled)

Expected behavior

The Desktop should remain open after a session conversation completes, allowing the user to continue working or ask follow-up questions.

Actual behavior

The Desktop exits cleanly (exit code 0) immediately after the AI's response completes. No crash, no error dialog — the window simply disappears.

Evidence

Debug log (Chromium verbose, --enable-logging --v=1)

The shutdown sequence shows a clean, intentional Electron shutdown (not a crash):

[15:28:37] Last Display event
[15:28:39] Bluetooth: Shutdown          ← Electron starts shutdown
[15:28:39] Collections of all histograms ← Chromium normal teardown
→ Exit code: 0

No crash dumps (.dmp) were generated anywhere in %LOCALAPPDATA%\Temp\.

main.log (%APPDATA%\ai.opencode.desktop\logs\main.log)

The application log never records exit events for affected versions:

  • No app quitting, before-quit, window-all-closed, or will-quit log entries
  • Only "quitAndInstall" logs exist from earlier auto-update flows
  • Multiple truncated startup attempts where only a single app starting line was logged before the process terminated

Sidecar logs (%LOCALAPPDATA%\ai.opencode.desktop\logs\)

  • Sidecar logs exist up to v1.14.35 (last: 2026-05-05)
  • No sidecar logs were generated for v1.14.40 at all — suggesting the sidecar never completed initialization before the main process exited

Version binary search results

Version Auto-exit after session Test date
v1.14.33 No (working) 2026-05-07
v1.14.35 Yes 2026-05-07
v1.14.37 Yes 2026-05-07
v1.14.39 Yes 2026-05-07
v1.14.40 Yes 2026-05-07

Regression window: v1.14.33 → v1.14.35 (v1.14.34 untested)

Release notes analysis

The v1.14.34 release includes changes that are suspicious given the regression window (though v1.14.34 itself was not tested):

  1. "Detect when an agent is invoked from stdin to avoid hanging" — modifies stdin/process lifecycle management. This is the most likely candidate, as it could cause the main process to interpret session completion as stdin EOF and trigger a quit.

  2. "Auto-install tools from conversation attachments and settings" — may run at session completion and trigger unexpected behavior.

  3. "Use spawn to open URLs instead of exec for better reliability" — changes process spawning behavior.

The v1.14.35 release also includes session-related changes that could be responsible.

A RADAR_PRE_LEAK_64 event (Event ID 1001, Windows Error Reporting) was logged for v1.14.39 on 2026-05-06, indicating a potential memory leak. However, this was not the cause of the auto-exit (exit code 0 rules out OOM kill).

Possible cause

The v1.14.34 release includes changes that are highly suspicious given the regression window:

  1. "Detect when an agent is invoked from stdin to avoid hanging" — modifies stdin/process lifecycle management. This is the most likely candidate, as it could cause the main process to interpret session completion as stdin EOF and trigger a quit.

  2. "Auto-install tools from conversation attachments and settings" — may run at session completion and trigger unexpected behavior.

  3. "Use spawn to open URLs instead of exec for better reliability" — changes process spawning behavior.

The combination of clean shutdown traces + no crash evidence + exit code 0 + main.log never recording normal exit events strongly suggests that app.quit() is being called programmatically in response to some session-completion event.

Additional context

  • Downgrading to v1.14.33 completely resolves the issue
  • v1.14.34 was not tested — installing and testing it would narrow the regression to a single version
  • The application data directory is at %APPDATA%\ai.opencode.desktop\
  • No crash dumps, no Windows Event Log errors (Application Error 1000/1002) were found

Plugins

No response

OpenCode version

v1.14.35 / v1.14.37 / v1.14.39 / v1.14.40

Steps to reproduce

Steps to reproduce

  1. Launch OpenCode Desktop (any version >= v1.14.35)
  2. Create a new session
  3. Ask any question and wait for the AI to finish responding
  4. Observe: the Desktop window exits automatically — no manual close action was taken
  5. Verify: the cmd window (if launched via batch) shows Exit code: 0

Screenshot and/or share link

No response

Operating System

Windows 11 (x64)

Terminal

cmd

Activity

  1. github-actions commented on Jul 8, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions