-
-
Notifications
You must be signed in to change notification settings - Fork 834
Open
Labels
agentsRelated to agent definitionsRelated to agent definitions
Description
Bug Description
When a Claude Code session terminates, OMC-spawned child processes are not cleaned up and remain as orphaned processes (PPID 1). Over time, this causes severe memory exhaustion.
Observed Behavior
On a 48GB RAM Mac, memory free dropped to 39% due to accumulated orphaned processes:
| Process | Count | Description |
|---|---|---|
gyoshu_bridge.py |
95 | MCP bridge Python processes (all PPID 1) |
omx hud --watch |
6 | HUD watcher node processes |
codex --dangerously-bypass-approval |
5+ | Stale codex sessions |
oh-my-codex MCP servers |
~30 | Codex MCP child processes |
Total: ~116 node processes (3.5 GB) and ~95 Python processes orphaned.
After manual cleanup: memory free went from 39% → 75%.
Root Cause (suspected)
When the parent Claude Code process exits, child processes spawned by OMC are not receiving SIGTERM. The gyoshu_bridge.py bridge process does not appear to detect parent process termination and self-terminate.
Expected Behavior
When a Claude Code session exits:
gyoshu_bridge.pyshould detect parent exit and self-terminateomx hud --watchshould be killed- All codex/oh-my-codex child processes should be cleaned up
Possible Fix
- Set up a parent PID watcher in
gyoshu_bridge.py(e.g., pollos.getppid()or useprctl(PR_SET_PDEATHSIG)equivalent on macOS) - Use process groups so all children can be killed together via
killpg() - Register cleanup in Claude Code's exit hook
Environment
- OMC version: 4.8.2
- OS: macOS (Darwin 25.3.0, Apple Silicon)
- RAM: 48 GB
- Claude Code sessions: 14 concurrent sessions before cleanup
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
agentsRelated to agent definitionsRelated to agent definitions