Skip to content

bug(desktop): orphaned opencode-cli processes on Linux after app exit #11959

Closed

Description

@IsraelAraujo70

Problem

On Linux, the desktop app leaves opencode-cli sidecar processes running after the UI exits or crashes. This accumulates orphaned processes and memory usage. Windows has job objects; Linux had no equivalent cleanup.

Repro

  1. Launch the desktop app.
  2. Open a project / start the local sidecar server.
  3. Close the app or crash/kill the UI.
  4. ps still shows opencode / opencode-cli processes running.

Fix (already implemented in branch)

  • Add Linux process group management with PR_SET_PDEATHSIG and setsid for child cleanup.
  • Track PIDs and kill process groups on exit.
  • Spawn sidecar on Linux with pre_exec calling configure_child_process.
  • Add libc dependency for prctl/setsid.

Commit: 4bd93a5a5 (fix(desktop): ensure child processes are killed on Linux when app exits).

Verification

Closing the app now sends SIGTERM to the child and its process group; no orphan processes remain.

Activity

  1. github-actions commented on Feb 3, 2026

    @github-actions
    Contributor

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

    These issues all describe similar orphaned process problems. The Linux-specific solution you've implemented (using PR_SET_PDEATHSIG and setsid) may help resolve multiple related issues beyond just the desktop app.

    Feel free to ignore if this specific Linux desktop app scenario is distinct from these other cases.

  2. github-actions commented on Apr 5, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 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

webRelates to opencode on web / desktop

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions