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
[Bug]: Orca process (and spawned Codex/agent children) keeps running after window close, blocking clean relaunch #3191
On Windows, closing the Orca window does not fully terminate the app. The main
process and/or spawned child processes (the codex CLI, Node helpers, terminal/PTY
processes) keep running in the background. Relaunching while a stale instance is
alive leads to overlapping state writes (see the primary issue) and, in some cases,
a new window that doesn't behave as a clean start.
Steps to reproduce
Run a Codex agent / start a task in Orca on Windows.
Close the Orca window with the X.
Open Task Manager (or Get-CimInstance Win32_Process -Filter "Name LIKE '%orca%' OR Name='codex.exe'").
Actual behavior
One or more Orca / codex / Node / PTY processes remain running after the window
is closed. They are not cleaned up and must be killed manually (taskkill /T) to get
a fully clean relaunch.
Expected behavior
Closing/quitting Orca should terminate the full process tree it owns (main +
spawned agent/terminal children), or
If background runs are intentionally kept alive, provide a clear "Quit Orca" action
and an indicator that background agent processes are still running, plus a reliable
way to stop them all.
Notes
This is consistent with a documented Codex-on-Windows lifecycle problem: the UI window
closes but background processes remain, blocking relaunch, recoverable only by killing
the leftover processes in Task Manager.
Because Orca manages the Codex runtime (codex-runtime-home), this lifecycle bug is
likely the trigger for the duplicate-[hooks.state] corruption in the primary issue.
Issue #3190
I checked the shutdown path while fixing #3190. Current code intentionally does not kill the terminal daemon and its sessions during normal app quit: will-quit calls disconnectDaemon(), whose comment says the daemon survives app quit so sessions can warm-reattach on next launch. It does still call killAllPty() for the legacy/local provider, and Windows window-all-closed should call app.quit() after the last window closes.
So there are two different cases to separate:
Expected/current behavior: codex.exe, node-pty children, or daemon-owned terminal sessions remain after closing the window because Orca detached from the daemon instead of terminating sessions. This needs a product change such as a visible background-session indicator plus a “Quit and stop all sessions” command.
Bug: the Electron main Orca process itself remains after window-all-closed / quit. That should not happen, and we need process evidence to identify what will-quit is waiting on.
#3196 fixes the deterministic config corruption path from #3190 by making the managed Codex trust writer self-heal duplicate [hooks.state."..."] blocks. For this lifecycle issue, could you add a Task Manager / PowerShell capture with command lines after closing the window, e.g. the output of:
Opened a real terminal and captured its daemon management session/PID.
Clicked Orca's title-bar Close button.
Verified the isolated Electron main process exited.
Waited one second and verified terminal PID 9632 was still alive.
The E2E fixture then explicitly terminated the isolated daemon/session during cleanup.
So current behavior separates cleanly:
Not reproduced: the Orca Electron main process remaining after window close.
Reproduced: daemon-owned terminal/agent children remain after the app exits. Current code and the E2E cleanup helper explicitly describe this as intentional warm-reattach behavior.
This needs a product decision rather than a process-kill bug fix in the existing quit path. Reasonable options/trade-offs:
Keep warm reattach: fastest relaunch/session continuity, but Task Manager still shows Orca-owned background processes and users need a clear indicator/stop action.
Make window close stop all sessions: simplest process model, but closing the UI destroys running agents/terminals.
Preserve current X behavior and add a prominent Quit and stop all sessions command: keeps background work possible while giving users deterministic full shutdown.
Can the reporter confirm whether a current Orca Electron main process still survives on 1.4.133+, or whether the remaining entries are only daemon/terminal/agent processes? If it is only the latter, I recommend tracking the explicit quit/indicator UX as the resolution and treating the original main-process leak as not currently reproduced.
Closing as current intended behavior rather than a process leak: Orca's Electron main process exits, while daemon-owned terminal sessions survive briefly so they can be warmly reattached on relaunch. The reproduced process tree matches that design.
If the desired behavior is to terminate every session on exit, please open a feature request referencing #3191 for either a stop-on-close preference or an explicit Quit and stop all sessions action, including the user-facing trade-off you prefer.
Activity
nwparker commentedon May 29, 2026
I checked the shutdown path while fixing #3190. Current code intentionally does not kill the terminal daemon and its sessions during normal app quit:
will-quitcallsdisconnectDaemon(), whose comment says the daemon survives app quit so sessions can warm-reattach on next launch. It does still callkillAllPty()for the legacy/local provider, and Windowswindow-all-closedshould callapp.quit()after the last window closes.So there are two different cases to separate:
codex.exe, node-pty children, or daemon-owned terminal sessions remain after closing the window because Orca detached from the daemon instead of terminating sessions. This needs a product change such as a visible background-session indicator plus a “Quit and stop all sessions” command.window-all-closed/ quit. That should not happen, and we need process evidence to identify whatwill-quitis waiting on.#3196 fixes the deterministic config corruption path from #3190 by making the managed Codex trust writer self-heal duplicate
[hooks.state."..."]blocks. For this lifecycle issue, could you add a Task Manager / PowerShell capture with command lines after closing the window, e.g. the output of:The key detail is whether the surviving process is the Orca Electron main process, the daemon process, or daemon-owned agent/PTY children.
OrcaWin commentedon Jul 10, 2026
Reproduced the process split on Windows against current
mainat506f6ffbb(Orca1.4.133) with a real isolated Electron/ConPTY session.Observed process evidence:
{"ptyId":"c5142737-d9a4-4fd9-9649-d71c5210ee28::C:/Users/neil/AppData/Local/Temp/orca-e2e-repo-4gWSC1@@65b5fd01","terminalPid":9632,"foreground":"pwsh.exe","daemonTerminalSurvived":true}Sequence:
9632was still alive.So current behavior separates cleanly:
This needs a product decision rather than a process-kill bug fix in the existing quit path. Reasonable options/trade-offs:
Can the reporter confirm whether a current Orca Electron main process still survives on 1.4.133+, or whether the remaining entries are only daemon/terminal/agent processes? If it is only the latter, I recommend tracking the explicit quit/indicator UX as the resolution and treating the original main-process leak as not currently reproduced.
OrcaWin commentedon Jul 10, 2026
I think is intentional @Jinwoo-H ?
But we should give users a way to completely exit... maybe via a tray icon?
OrcaWin commentedon Jul 10, 2026
Closing as current intended behavior rather than a process leak: Orca's Electron main process exits, while daemon-owned terminal sessions survive briefly so they can be warmly reattached on relaunch. The reproduced process tree matches that design.
If the desired behavior is to terminate every session on exit, please open a feature request referencing #3191 for either a stop-on-close preference or an explicit Quit and stop all sessions action, including the user-facing trade-off you prefer.
fix(ime): derive non-composition IME text from the caret range
fix(ime): derive non-composition IME text from the caret range
fix(ime): derive non-composition IME text from the caret range
fix(ime): derive non-composition IME text from the caret range