{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreif6isbdqh25dth7o2gwwlrgnepizmfr5rtez32fz4mmlnkiemnxda",
    "uri": "at://did:plc:lk3jfj3zq4k4wxnk474axylu/app.bsky.feed.post/3mkt7fp5yt7b2"
  },
  "path": "/t/codex-windows-app-tray-exit-leaves-residual-processes-relaunch-can-return-a-broken-frame-shadow-only-window/1380171#post_1",
  "publishedAt": "2026-05-01T21:21:25.000Z",
  "site": "https://community.openai.com",
  "tags": [
    "Codex Windows App – UI closes but background processes remain, blocking relaunch",
    "Codex Windows App – Cannot Exit",
    "How does one quit the Codex application on Windows?"
  ],
  "textContent": "Hi,\n\nI think this is related to a few existing Windows Codex exit / relaunch reports, but I was able to dig a bit deeper into what seems to be happening.\n\n* * *\n\n## Related issues\n\n  * Codex Windows App – UI closes but background processes remain, blocking relaunch\n  * Codex Windows App – Cannot Exit\n  * How does one quit the Codex application on Windows?\n\n\n\nThose reports already suggest that Codex on Windows does not always exit cleanly.\nIn my case, I think I was able to narrow it down further with ProcMon.\n\n* * *\n\n## Summary\n\nSometimes after right-clicking the Codex tray icon and choosing Exit, Codex does not fully terminate.\nIf I relaunch it in that residual state, the app can come back in a broken UI state — the outer window frame / shadow appears, but the inner renderer does not initialize properly.\n\nForce-killing the remaining `Codex.exe` processes restores normal startup.\n\n* * *\n\n## TL;DR\n\n  * Tray Exit does not always terminate all Codex processes\n  * Leftover `Codex.exe` processes can remain running in the background\n  * Relaunch starts a new `Codex.exe` process that exits quickly with status 0\n  * Control seems to hand off / attach to the leftover instance\n  * If that leftover instance is already in a bad state, the UI returns as a broken frame/shadow-only window\n  * Killing all `Codex.exe` processes fixes it\n\n\n\n* * *\n\n## Symptoms\n\nWhat I observed:\n\n  * Right-click tray icon → Exit does not always fully terminate Codex\n  * Multiple `Codex.exe` processes can remain visible in Task Manager\n  * Relaunching Codex in that residual state can produce a broken frame/shadow-only window\n  * Force-killing the remaining `Codex.exe` processes restores normal startup\n\n\n\n* * *\n\n## Possible trigger\n\nI cannot reproduce it reliably with very light use.\nIt seems much more likely after longer / heavier sessions.\n\nMy current working theory:\n\n\n    heavy / long session\n    → incomplete tray Exit\n    → residual processes remain\n    → relaunch attaches to broken residual instance\n    → UI comes back corrupted\n\n\n* * *\n\n## ProcMon findings\n\nI recorded one bad relaunch case with Process Monitor.\n\n### Residual processes remained alive after tray Exit\n\nThe following `Codex.exe` PIDs remained alive after Exit:\n\n\n    6036 / 2304 / 3332 / 1420\n\n\nThese were not ghost entries — they kept emitting `Process Profiling` events in ProcMon.\n\n### Residual processes were still doing real work\n\n  * PID 1420 kept generating TCP/UDP traffic (`host.docker.internal ...`)\n  * PID 6036 kept accessing and writing under `C:\\Users\\<user>\\AppData\\Local\\Packages\\OpenAI.Codex_...`\n\n\n\nSo this was not just “the UI is closed but stale process names remain.”\nActual background activity continued after Exit.\n\n### Relaunch started a new process that exited cleanly\n\n\n    2:01:48.3635698  Codex.exe 9536  Process Start\n    2:01:49.0226769  Codex.exe 9536  Process Exit  (Exit Status: 0)\n\n\nThe new process exited in about 0.66 seconds with status 0, so this does not look like an outright crash. It looks more like the app detected an existing instance and exited along its normal path.\n\n* * *\n\n## Working theory\n\nThis looks like a **single-instance / lifecycle bug**.\n\nCodex appears to try to reuse or attach to an already-running instance on relaunch.\nThe problem is that after some tray Exit cases, the old instance is not fully cleaned up.\nIf that residual instance is already in a bad state, the relaunched UI does not initialize properly and comes back as a broken frame/shadow-only window.\n\nCompared to the earlier reports above, the additional things I was able to confirm:\n\n  * The old processes really do remain alive after Exit\n  * They continue doing real background work\n  * Relaunch creates a new process, but that process exits normally instead of crashing\n  * This makes it look more like a **failed handoff / attach to a bad leftover instance**\n\n\n\n* * *\n\n## Question\n\nHas anyone else seen this on Windows? Specifically:\n\n  * `Codex.exe` processes remaining after tray Exit\n  * Relaunch attaching to an existing instance instead of starting clean\n  * Broken frame/shadow-only UI on relaunch\n  * Higher repro rate after heavy / long sessions\n\n\n\nIf needed, I can also share screenshots and the relevant ProcMon excerpts.",
  "title": "Codex Windows App: tray Exit leaves residual processes; relaunch can return a broken frame/shadow-only window"
}