{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreiavrjwltn7zdfpdnbjh37hfnk3e3aey62p64ctlrcw7av2brdlu54",
    "uri": "at://did:plc:lk3jfj3zq4k4wxnk474axylu/app.bsky.feed.post/3mln2au5haev2"
  },
  "path": "/t/possible-orphaned-python-subprocess-leak-in-codex-desktop-on-macos-apple-silicon/1380702#post_1",
  "publishedAt": "2026-05-12T04:16:52.000Z",
  "site": "https://community.openai.com",
  "textContent": "### Environment\n\n  * Platform: macOS Apple Silicon\n  * App: Codex Desktop\n  * Python installed via Homebrew\n  * Observed date: May 2026\n\n\n\n### Observed behavior\n\nAfter using Codex Desktop, I found a Python process continuing to run indefinitely even after the originating terminal/session appeared closed.\n\nThe process:\n\n  * remained alive with PPID = 1\n  * consumed ~99% CPU continuously\n  * persisted independently from the original shell session\n  * appeared to be reading from stdin rather than executing a normal .py file\n\n\n\n### Evidence\n\nProcess list:\n\nbash ps -Ao pid,ppid,pcpu,pmem,comm | sort -k3 -nr | head -20\n\nRelevant output:\n\ntext 65600 1 98.8 0.0 …/Python\n\nCommand inspection:\n\nbash ps -wwp 65600 -o command=\n\nOutput:\n\ntext /opt/homebrew/…/Python -\n\nThe trailing - suggests Python was launched using stdin piping/heredoc style execution rather than a standalone script.\n\nOpen files:\n\nbash lsof -p 65600 | head -50\n\nRelevant findings:\n\ntext cwd: /Users/…/Education/Physics/Nanoscience/Assignments stdin: /private/tmp/zshfhR7eo\n\nThis suggests:\n\n  * stdin-fed shell execution\n  * temporary zsh-backed input\n  * orphaned subprocess after parent shell exited\n\n\n\n### Why this looks Codex-related\n\nI found several existing reports describing similar process lifecycle issues:\n\n  * orphaned child processes\n  * subprocesses surviving terminal closure\n  * PPID reassignment to 1\n  * lingering high CPU usage\n  * pipe deadlocks / process-group cleanup failures\n\n\n\nExamples:\n\n  * #14962\n  * #7846\n  * #7932\n  * #13928\n\n\n\n### Suspected root cause\n\nThis appears consistent with:\n\n  * subprocess group cleanup failure\n  * missing signal propagation\n  * or child processes not being reaped correctly after Codex task execution\n\n\n\nPotentially related to:\n\n  * stdin-fed execution wrappers\n  * temporary shell pipes\n  * sandbox or process-group handling\n\n\n\n### Impact\n\nEffects observed:\n\n  * sustained high CPU usage\n  * orphaned processes surviving session exit\n  * difficult-to-identify background execution\n  * potential battery/thermal drain on laptops\n\n\n\n### Recommendation\n\nPossible mitigations:\n\n  * ensure subprocesses are attached to process groups\n  * propagate termination signals to descendants\n  * explicit child reaping on session/task completion\n  * cleanup of stdin-fed helper interpreters\n\n\n\nWould be useful if Codex exposed:\n\n  * task → subprocess mapping\n  * cleanup logs\n  * process lifecycle diagnostics\n  * automatic orphan detection\n\n",
  "title": "Possible orphaned Python subprocess leak in Codex Desktop on macOS (Apple Silicon)"
}