Skip to content

opencode-cli sidecar process not terminated when opencode electron desktop is closed #17068

Closed as not planned

Description

@xpaksi

Description

When closing the OpenCode Electron window, the opencode-cli sidecar process is not terminated. Re-launching the app spawns a new opencode-cli instance, causing multiple processes.

SIGTERM via Ctrl+C (when running the binary directly) correctly stops both the Electron window and the sidecar — but simply closing the Electron window does not, regardless of how the app was launched. Somehow running the binary directly, have faster startup time.

I can confirm this also happen in Opencode Electron Desktop on MacOS running on Macbook Air M2.

Plugins

I don't have any installed plugins

OpenCode version

1.2.24

Steps to reproduce

  1. Open the OpenCode Electron Desktop
  2. Close the Opencode Electron Desktop
  3. See the process list, in my case i'm using btop. opencode-cli process still running.
  4. Open the OpenCode Electron Desktop again. It will spawn another opencode-cli process.
  5. I have to kill it manually in order to kill the opencode-cli process

Screenshot and/or share link

Image

Operating System

ArchLinux x86_64

Activity

  1. github-actions commented on Mar 11, 2026

    @github-actions
    Contributor

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

    While those issues focus on the TUI/CLI process not handling SIGHUP when a terminal closes, the root symptom (opencode-cli processes not terminating on close) is similar. It may be worth checking if the Electron desktop app's sidecar management is related to or a separate instance of the same underlying cleanup issue.

  2. added a commit that references this issue on Apr 17, 2026
    5deadbc
  3. vaishnavmhetre commented on Apr 17, 2026

    @vaishnavmhetre

    I've opened a fix for this in #23018 — adds a window-all-closed handler to the Electron app so the opencode-cli serve sidecar gets killed when the window is closed on macOS.

    Root cause: on macOS, closing the window doesn't quit Electron, so the existing before-quit/will-quit cleanup hooks never fire. The sidecar survives indefinitely.

  4. removed
    bugSomething isn't working
    webRelates to opencode on web / desktop
    on May 3, 2026
  5. github-actions commented on Jul 4, 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