You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MCP server processes not cleaned up on exit (orphan processes) + eagerly starts all servers #30123
When OpenCode exits, MCP server child processes are not killed, leaving orphan processes running indefinitely. Additionally, OpenCode eagerly starts ALL configured stdio-type MCP servers at launch regardless of whether they will be used.
Impact
30 orphan node.exe processes accumulated (from just 2 sessions), each consuming 45-75MB RAM
When OpenCode exits, it does not cascade SIGTERM/kill to child processes
The cmd /c wrapper exits early (by design of /c), making npx and MCP server orphans
Windows does not auto-clean orphan processes — they run forever waiting on closed stdin
All MCP servers are started eagerly
Even if a session never uses avily, exa, memory, sequential-thinking, or context7, all of them are launched at startup. This wastes CPU and memory on every session.
Expected Behavior
On exit: OpenCode should kill all spawned child processes (the entire process tree)
On startup: MCP servers should be lazily started only when first needed (or at least have a config option for this)
Alternatively: MCP servers should detect stdin EOF and exit themselves
If your issue is distinct (e.g., the eager startup behavior or the Windows-specific cmd /c process tree issue), please clarify what is not covered by the above issues.
Activity
github-actions commentedon May 31, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is distinct (e.g., the eager startup behavior or the Windows-specific cmd /c process tree issue), please clarify what is not covered by the above issues.
github-actions commentedon Jul 31, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.