Skip to content

opencode process orphans when its parent exits #13001

@nickjvandyke

Description

@nickjvandyke

Description

nickjvandyke/opencode.nvim#118

This is a big problem because:

  1. The plugin will auto-connect to orphaned opencode processes that have no TUI
  2. Even if I worked around the above, each opencode process consumes ~500MB of memory

Plugins

none

OpenCode version

1.1.53

Steps to reproduce

  1. Launch opencode in a way that gives it a parent process. e.g. Neovim's vim.fn.jobstart or, directly in your terminal, fish -c opencode or (untested, but presumably) bash -c opencode
  2. pgrep -fl opencode to find the parent and opencode PIDs
  3. kill -9 <parent_pid>
  4. pgrep -fl opencode, observe that opencode itself is still running
  5. ps -o ppid= -p <opencode_pid>, observe that opencode's parent PID is now 1

I'm not certain this is directly opencode's fault, but it appeared only recently, and I can't think what would have changed otherwise.

Screenshot and/or share link

Image

Operating System

macOS 15.6.1

Terminal

Ghostty

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingperfIndicates a performance issue or need for optimization

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions