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]: "Failed to physically stop every PTY" — worktree deletion fails, requires manually killing orphaned claude.exe/node.exe/cmd.exe processes #9044
Agent CLIs used in worktrees: Claude Code, Codex, Kilo Code
Bug
Deleting a worktree fails consistently with:
Error invoking remote method 'worktrees:remove': Error: Failed to physically stop every PTY for worktree: ::
or, on the "Force Delete" path:
Error invoking remote method 'worktrees:remove': Error: Timed out waiting for physical PTY teardown: ::
This has now happened on two separate worktrees ("snaggletooth" and "anhinga"), so it appears to be reproducible rather than a one-off.
Root cause (as far as I can tell)
Using Sysinternals handle.exe on the worktree folder shows dozens of orphaned processes still holding open file handles into the worktree directory — claude.exe, node.exe, and cmd.exe, well beyond what should be running for a single session (20+ handles across repeated cmd.exe/node.exe instances). It looks like Orca is not properly terminating child processes (PTYs spawned for agent CLIs) when a worktree/session is closed, so they linger and block folder deletion.
Steps to reproduce
Run an agent (Claude Code / Codex / Kilo Code) inside an Orca worktree.
Close the session / try to delete the worktree from the UI.
Deletion fails with the PTY teardown error above.
Inspecting the worktree folder with handle.exe shows many orphaned claude.exe/node.exe/cmd.exe processes still holding file handles.
Current workaround
Manually force-kill the relevant processes, then delete the folder:
A full OS restart also works but obviously isn't a practical daily workflow.
Expected behavior
When a worktree is closed or deleted, Orca should reliably terminate all child processes/PTYs it spawned (including nested node/cmd processes from CLI agents) before attempting folder removal, without requiring manual process killing or a system restart.
Activity
AmethystLiang commentedon Jul 19, 2026
Duplicate of #9045 (same author / same body).
This issue was closed without discussion; investigation and ongoing work live on #9045.