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
- Launch OpenCode Desktop on macOS
- Use the app normally (the app spawns
opencode-cli serve as a sidecar)
- Quit the OpenCode Desktop app (Cmd+Q or menu → Quit)
- 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
Environment
- OS: macOS
- OpenCode: Desktop app (latest)
- Architecture: Apple Silicon (arm64)
Description
When closing the OpenCode Desktop app on macOS, the spawned
opencode-cli servechild processes are not terminated. They remain running as orphans, consuming significant CPU and memory.Steps to Reproduce
opencode-cli serveas a sidecar)ps aux | grep opencodeExpected Behavior
All
opencode-cli servechild processes should be terminated when the Desktop app quits.Actual Behavior
opencode-cli serveprocesses 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:
Each process consumed ~65-72% CPU and ~350-430MB RAM, totaling ~350% CPU and ~2GB RAM.
Workaround
Environment