Skip to content

Bug: Desktop app does not terminate opencode-cli serve child processes on quit (macOS) #24600

@chenyizhe

Description

@chenyizhe

Description

When closing the OpenCode Desktop app on macOS, the spawned opencode-cli serve child processes are not terminated. They remain running as orphans, consuming significant CPU and memory.

Steps to Reproduce

  1. Launch OpenCode Desktop on macOS
  2. Use the app normally (the app spawns opencode-cli serve as a sidecar)
  3. Quit the OpenCode Desktop app (Cmd+Q or menu → Quit)
  4. Run ps aux | grep opencode

Expected Behavior

All opencode-cli serve child processes should be terminated when the Desktop app quits.

Actual Behavior

opencode-cli serve processes remain running after the Desktop app is closed. Each new launch/restart accumulates additional orphan processes.

Observed 5 orphan processes after a few days of normal usage:

chenyizhe  5929  71.6%  2.6%  opencode-cli serve --hostname 127.0.0.1 --port 63714
chenyizhe  7077  71.3%  2.6%  opencode-cli serve --hostname 127.0.0.1 --port 64335
chenyizhe 95875  68.9%  2.2%  opencode-cli serve --hostname 127.0.0.1 --port 49585
chenyizhe 77393  67.1%  2.2%  opencode-cli serve --hostname 127.0.0.1 --port 52235
chenyizhe 83197  66.5%  2.2%  opencode-cli serve --hostname 127.0.0.1 --port 60205

Each process consumed ~65-72% CPU and ~350-430MB RAM, totaling ~350% CPU and ~2GB RAM.

Workaround

pkill -9 -f opencode-cli

Environment

  • OS: macOS
  • OpenCode: Desktop app (latest)
  • Architecture: Apple Silicon (arm64)

Metadata

Metadata

Assignees

Labels

webRelates to opencode on web / desktop

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions