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] Closing a terminal tab does not actually kill the terminal, it survives in the background #9744
Triage note (automated bug-bash; not a maintainer verdict — please reopen with details if you still hit this).
I couldn't tie this report to a defect on the current tree. Recording what was ruled out so the next person doesn't redo it:
The obvious suspect is the fail-closed branch in terminal-tab-retirement.ts that files PTYs under unroutablePtyIds (never killed). But the timeline rules it out for this report: that branch was added by 41751dd90d on 2026-07-23, about 35 hours after this issue was filed. At the commit current when you reported it, every plain (non-remote:) PTY id went to localOrSshPtyIds and was killed.
@dvi — your follow-up ("This is on a remote host", and closed tabs coming back when you prompt in the agent tab) points somewhere different: for remote-owned worktrees the renderer intentionally doesn't kill the PTY, the host does (remoteCloseOwnedByHost: true), and if the host doesn't honor the close its next snapshot re-adds the tab. That's consistent with the reappearing tabs.
Most useful next step: the remote host type (SSH / relay / WSL), the Orca version, and whether the shell process survives on the host after closing. That would let someone target the host-side close path directly.
Separately, the fail-closed gap above is a real leak on current HEAD for floating and ephemeral-setup terminals — I've flagged it to the team as its own bug rather than folding it in here.
It took no close reason, had zero refusal branches, and killed PTYs unconditionally. Meanwhile the renderer intentionally does not kill remote PTYs — it prunes the local mirror and delegates to the host (remoteCloseOwnedByHost: true). So when the host didn't honor a close, the shell survived (your symptom 1) and the host's next snapshot still listed the tab, which re-added it (your symptom 2 — "closed tabs come back when I prompt in the agent tab"). One root cause, both symptoms, and consistent with "this is on a remote host".
Both are ancestors of v1.4.151 and not of v1.4.148/149/150. On current main, closeMobileSessionTab takes an explicit reason and has 6 refusal branches (unknown-liveness, stale-publication, stale-terminal, live-host-pty, retirement-owner, missing-intent) plus PTY-liveness checks, and killPtys is gated on the close actually being a user close.
What was ruled out
The obvious suspect — the fail-closed unroutablePtyIds bucket in the retirement planner — is not this bug, on timeline: that branch was introduced by 41751dd90d on 2026-07-22 21:25, ~31 hours after you filed. On your build every plain (non-remote:) PTY id went to localOrSshPtyIds and was killed. That was a separate real bug, fixed separately in #10810.
I also want to correct something from the earlier triage note on this issue: it cited b55c7f29e9 "make remote terminal close host-authoritative" as relevant. That commit never merged — it isn't an ancestor of main and its symbols don't exist in the tree. It's not part of the fix; the two commits above are.
Honest caveat
I could not reproduce your exact scenario end-to-end against a live remote host — this is a code-level determination (your build lacked the guards; current main has them), not a live repro on v1.4.148 hardware.
While investigating I did reproduce some real robustness gaps in the remote-close path — the close-intent suppression window is a one-shot 10s TTL with no retry, it's cleared wholesale on any RPC error, and every closeWebRuntimeSessionTab call site discards the returned success boolean. Those are genuine and worth hardening, but I convinced myself they are not what you hit: every path they affect requires a host refusal, and all refusal branches are gated on reason !== 'user'. A user closing a tab sends reason: 'user' and reaches the unconditional kill. I'm tracking those separately rather than folding them in here.
If it still happens
Reopen with: your Orca version, the remote host type (SSH / relay / WSL), and whether the shell is still alive on the host (ps there) after closing the tab. That last one separates "the host never killed it" from "the tab mirror is stale", which are different bugs.
Activity
orca-discord-issues commentedon Jul 21, 2026
via Discordcan you mention any of the example for ref like was it codex session, development server or anything else
orca-discord-issues commentedon Jul 21, 2026
via Discordalso observed: when I close terminal tabs, and make a new prompt in my agent tab, the previously closed terminal tabs will come back.
This is on a remote host but im 90% sure my friend (using Orca locally) was experiencing the same thing.
see video attached
Desktop_2026.07.21_-_10.15.34.01.mp4
orca-discord-issues commentedon Jul 21, 2026
via Discordtrying to fix this also here: #9739
orca-discord-issues commentedon Jul 21, 2026
via DiscordStill draft, feel free to build it
nwparker commentedon Jul 26, 2026
Triage note (automated bug-bash; not a maintainer verdict — please reopen with details if you still hit this).
I couldn't tie this report to a defect on the current tree. Recording what was ruled out so the next person doesn't redo it:
The obvious suspect is the fail-closed branch in
terminal-tab-retirement.tsthat files PTYs underunroutablePtyIds(never killed). But the timeline rules it out for this report: that branch was added by41751dd90don 2026-07-23, about 35 hours after this issue was filed. At the commit current when you reported it, every plain (non-remote:) PTY id went tolocalOrSshPtyIdsand was killed.@dvi — your follow-up ("This is on a remote host", and closed tabs coming back when you prompt in the agent tab) points somewhere different: for remote-owned worktrees the renderer intentionally doesn't kill the PTY, the host does (
remoteCloseOwnedByHost: true), and if the host doesn't honor the close its next snapshot re-adds the tab. That's consistent with the reappearing tabs.Most useful next step: the remote host type (SSH / relay / WSL), the Orca version, and whether the shell process survives on the host after closing. That would let someone target the host-side close path directly.
Separately, the fail-closed gap above is a real leak on current HEAD for floating and ephemeral-setup terminals — I've flagged it to the team as its own bug rather than folding it in here.
nwparker commentedon Jul 27, 2026
Closing as fixed in v1.4.151. @dvi if you still see this on v1.4.151 or later, please reopen — details at the bottom of what would help.
What was wrong on your build
You were on v1.4.148 (tagged 2026-07-21 08:10 UTC; you filed at 14:13; v1.4.149 didn't exist until 21:55).
On that build the host side of a remote tab close was genuinely unguarded:
It took no close reason, had zero refusal branches, and killed PTYs unconditionally. Meanwhile the renderer intentionally does not kill remote PTYs — it prunes the local mirror and delegates to the host (
remoteCloseOwnedByHost: true). So when the host didn't honor a close, the shell survived (your symptom 1) and the host's next snapshot still listed the tab, which re-added it (your symptom 2 — "closed tabs come back when I prompt in the agent tab"). One root cause, both symptoms, and consistent with "this is on a remote host".What fixed it
b232df732b— fix(terminal): make remote agent sessions host-authoritative (fix(terminal): make remote agent sessions host-authoritative #9687)f9f3cd2fbe— fix(terminal): prevent reconnect from killing live daemon sessions (fix(terminal): prevent reconnect from killing live daemon sessions #9804)Both are ancestors of v1.4.151 and not of v1.4.148/149/150. On current
main,closeMobileSessionTabtakes an explicit reason and has 6 refusal branches (unknown-liveness,stale-publication,stale-terminal,live-host-pty,retirement-owner,missing-intent) plus PTY-liveness checks, andkillPtysis gated on the close actually being a user close.What was ruled out
The obvious suspect — the fail-closed
unroutablePtyIdsbucket in the retirement planner — is not this bug, on timeline: that branch was introduced by41751dd90don 2026-07-22 21:25, ~31 hours after you filed. On your build every plain (non-remote:) PTY id went tolocalOrSshPtyIdsand was killed. That was a separate real bug, fixed separately in #10810.I also want to correct something from the earlier triage note on this issue: it cited
b55c7f29e9"make remote terminal close host-authoritative" as relevant. That commit never merged — it isn't an ancestor ofmainand its symbols don't exist in the tree. It's not part of the fix; the two commits above are.Honest caveat
I could not reproduce your exact scenario end-to-end against a live remote host — this is a code-level determination (your build lacked the guards; current
mainhas them), not a live repro on v1.4.148 hardware.While investigating I did reproduce some real robustness gaps in the remote-close path — the close-intent suppression window is a one-shot 10s TTL with no retry, it's cleared wholesale on any RPC error, and every
closeWebRuntimeSessionTabcall site discards the returned success boolean. Those are genuine and worth hardening, but I convinced myself they are not what you hit: every path they affect requires a host refusal, and all refusal branches are gated onreason !== 'user'. A user closing a tab sendsreason: 'user'and reaches the unconditional kill. I'm tracking those separately rather than folding them in here.If it still happens
Reopen with: your Orca version, the remote host type (SSH / relay / WSL), and whether the shell is still alive on the host (
psthere) after closing the tab. That last one separates "the host never killed it" from "the tab mirror is stale", which are different bugs.