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
fix(terminal): don't confirm closing an unverifiable idle pane - #50716
When you close a small terminal inside a split tab, Orca was asking "an agent is still running?" even for a terminal that was just sitting idle. It asked because it could not check whether anything was running, and "cannot check" was being treated the same as "definitely running". Now only a real running answer — or a pane on another computer where killing sight-unseen is the real risk — asks first.
What Changed
handleRequestClosePane in use-terminal-pane-close-actions.ts escalated every probe verdict except 'exited' into confirmClose(). The probe returns 'exited' only when it proves the pty has no children; for a pane the window cannot observe (a remote pane, an unreadable host process table, a probe that could not answer) it returns 'unverifiable', and the pane path prompted for every unverifiable.
Now the busy test is verdict === 'live' || (verdict === 'unverifiable' && probe.remote). An unverifiablelocal pane closes without prompting — the probe could not find anything, and "cannot tell" is not evidence an agent is running. An unverifiableremote pane (probe.remote, i.e. owned by a relay runtime or app SSH host) and a live pane still ask, matching the rule the sibling tab-close guard already applies: do not kill work on a host you cannot see.
The verdict is also only trusted for the pty it was asked about. The transport is captured when the close is requested; if the pane was restarted while the probe was out, paneTransportsRef now holds another one, and the stale answer no longer closes the pane silently — it asks.
Why
The alternative was to keep prompting for all unverifiable answers, which is the reported bug: "cannot inspect" is not the same as "is running". The alternative of matching the tab guard's bound-pty check instead of remote was rejected for the pane case: a pane close carries its own pty, so remote (the probe's own host-ownership signal) is the cleaner seam than consulting the tab's bound-id map for a different ambiguity (layout-leaf vs bound). The timeout unanswered-probe still reaches the dialog through the existing probeTimeout fallback, so a never-answered probe is unchanged.
N/A — no UI change; the behavior is only visible in whether closing an unverifiable split pane prompts.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
use-terminal-pane-close-actions.test.ts stubs only the probePtyRunningWork seam (and the store/pane plumbing around it), then drives the real handler:
an unverifiable local probe must close with no setPendingCloseConfirmation (fails before the fix — it prompted);
a live probe must confirm, and an unverifiable remote probe must still confirm;
a probe held open while the pane's transport is swapped (what a restart does) must then confirm on an unverifiable answer, not close (fails without the restart guard).
tc:web, oxlint and oxfmt are clean; check:changed passes 32/32 on the branch.
Performance
None — the change is in the confirmation decision, not the probe; no extra RPCs.
Risk
Level: Low
The riskiest part is that a local pane whose process table is genuinely unreadable now closes silently instead of asking — that is the intended trade, and it matches what the tab-close guard does for an unverifiable layout-only candidate. A remote unverifiable still prompts, and a pane restarted mid-probe is treated as unknown rather than trusted, so the only newly-silent case is one the local window could not inspect and would only have prompted about anyway. Backout is a plain revert.
AI Disclosure
Written with Claude Code.
Review
Self-reviewed against the failure mode: the false prompt was reproduced in a test before the fix, and the same test passes after it; the remote, live and restarted cases are asserted so the relaxation cannot hide a real busy pane.
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Cross-platform: the verdict paths are host-agnostic; the change only affects which verdicts trigger the dialog.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
Closing an idle pane of a split tab popped the "an agent is still
running" confirmation even when nothing was running. handleRequestClosePane
only treated the probe's 'exited' verdict as safe and escalated every
other verdict, so an 'unverifiable' answer (host the window could not
observe, failed inspection, or an unanswered probe) became a confirm
dialog for a pane that was not running anything.
The pane path now matches the tab-close guard's split between "known
busy" and "unknown": only a 'live' verdict, or an 'unverifiable' verdict
on a remote pane (probe.remote), requests confirmation. An unverifiable
local pane closes.
Co-Authored-By: Claude Code <[email protected]>
No actionable comments were generated in the recent review.
Walkthrough
The pane close action treats live work and unverifiable probes on remote panes as busy. If the probe is not busy and the pane transport has not changed, it closes without confirmation. A changed transport requires confirmation unless the skip-confirmation setting is enabled. Tests cover these decisions, including a transport change while the probe is pending.
Severity of issue fixed: Low
Merge Risk: Minimal · up to 0623f
Closing an idle local pane whose probe cannot be verified no longer shows a spurious "agent still running" prompt. Live panes and remote unverifiable panes still ask first. A pane that restarts while its close probe is running now asks for confirmation instead of being closed silently. No merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(terminal): don't confirm closing an unverifiable idle pane" states the main change: an unverifiable local pane now closes without a confirmation prompt. It matches the summary, objectiv…
Linked Issues check
Issue #50711 requires that an unverifiable local pane close without a prompt. Only a live pane, or an unverifiable remote pane, may prompt. At the reviewed head, handleRequestClosePane in use-terminal…
Out of Scope Changes check
The production change is limited to the pane-close decision in use-terminal-pane-close-actions.ts. It has two parts. The first is the busy predicate for #50711. The second is a restart guard: when no …
Description check
The description explains the bug (an unverifiable local pane prompted for confirmation), the mechanism (busy test changed to verdict === 'live' || (verdict === 'unverifiable' && probe.remote)), the re…
Full details: Title check
Explanation
The title "fix(terminal): don't confirm closing an unverifiable idle pane" states the main change: an unverifiable local pane now closes without a confirmation prompt. It matches the summary, objectives, and linked issue #50711. The title is specific, short, and follows a conventional commit style. It does not mention the remote/live confirmation path or the restart safeguard, but it does not need to cover every detail.
Full details: Linked Issues check
Explanation
Issue #50711 requires that an unverifiable local pane close without a prompt. Only a live pane, or an unverifiable remote pane, may prompt. At the reviewed head, handleRequestClosePane in use-terminal-pane-close-actions.ts sets busy = verdict === 'live' || (verdict === 'unverifiable' && probe.remote). When busy is false, the handler calls close(). This matches the issue. The probeTimeout fallback still calls confirmClose() for an unanswered probe. The issue does not require a change to that fallback. The restart check (paneTransportsRef.get(paneId) !== transport) adds no unmet requirement. The PR objectives report tests for the unverifiable local, live, and unverifiable remote cases. The test file was not read in this review; that evidence comes from the PR summary and the raw summary. No unmet coding requirement was found.
Full details: Out of Scope Changes check
Explanation
The production change is limited to the pane-close decision in use-terminal-pane-close-actions.ts. It has two parts. The first is the busy predicate for #50711. The second is a restart guard: when no pending close exists and the pane's transport differs from the captured transport, the handler confirms instead of closing. The restart guard is in the same decision path and protects the same risk, which is closing a PTY that the verdict did not examine. It is not demonstrably unrelated to #50711. The current PR description does not mention the restart guard, so the description is incomplete. The restart guard changes behavior for a restarted pane, which reviewers should confirm. A new test file covers the handler. No unrelated file or behavior change was found.
Full details: Description check
Explanation
The description explains the bug (an unverifiable local pane prompted for confirmation), the mechanism (busy test changed to verdict === 'live' || (verdict === 'unverifiable' && probe.remote)), the restart guard, and the rationale against the alternatives. It links the issue (Fixes #50711), states testing with a Testing section, and gives a risk level and rollback. Performance and visual proof are covered with reasons. Minor gaps: the 'Level' is filled but the template's 'Visual Proof' N/A is explained, and the final lint/typecheck/test/build checkbox is left unchecked, which the author should confirm before merge. The description is largely complete, so it passes.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
…was out
The probe verdict describes the PTY captured at the close request; a pane that
restarted since then holds a different, possibly live PTY. Before the automatic
close path only (the unverifiable-local close and the skip-confirm setting), require
paneTransportsRef still holds the captured transport; otherwise show the
confirmation instead of closing the replacement. Live and remote-unverifiable
verdicts already ask, so only the auto-close branch needed the check.
Co-Authored-By: Claude Code <[email protected]>
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
When you close a small terminal inside a split tab, Orca was asking "an agent is still running?" even for a terminal that was just sitting idle. It asked because it could not check whether anything was running, and "cannot check" was being treated the same as "definitely running". Now only a real running answer — or a pane on another computer where killing sight-unseen is the real risk — asks first.
What Changed
handleRequestClosePaneinuse-terminal-pane-close-actions.tsescalated every probe verdict except'exited'intoconfirmClose(). The probe returns'exited'only when it proves the pty has no children; for a pane the window cannot observe (a remote pane, an unreadable host process table, a probe that could not answer) it returns'unverifiable', and the pane path prompted for everyunverifiable.Now the busy test is
verdict === 'live' || (verdict === 'unverifiable' && probe.remote). Anunverifiablelocal pane closes without prompting — the probe could not find anything, and "cannot tell" is not evidence an agent is running. Anunverifiableremote pane (probe.remote, i.e. owned by a relay runtime or app SSH host) and alivepane still ask, matching the rule the sibling tab-close guard already applies: do not kill work on a host you cannot see.The verdict is also only trusted for the pty it was asked about. The transport is captured when the close is requested; if the pane was restarted while the probe was out,
paneTransportsRefnow holds another one, and the stale answer no longer closes the pane silently — it asks.Why
The alternative was to keep prompting for all unverifiable answers, which is the reported bug: "cannot inspect" is not the same as "is running". The alternative of matching the tab guard's bound-pty check instead of
remotewas rejected for the pane case: a pane close carries its own pty, soremote(the probe's own host-ownership signal) is the cleaner seam than consulting the tab's bound-id map for a different ambiguity (layout-leaf vs bound). The timeout unanswered-probe still reaches the dialog through the existingprobeTimeoutfallback, so a never-answered probe is unchanged.Linked Issue
Fixes #50711
Visual Proof
N/A — no UI change; the behavior is only visible in whether closing an unverifiable split pane prompts.
Testing
use-terminal-pane-close-actions.test.tsstubs only theprobePtyRunningWorkseam (and the store/pane plumbing around it), then drives the real handler:unverifiablelocal probe must close with nosetPendingCloseConfirmation(fails before the fix — it prompted);liveprobe must confirm, and anunverifiableremote probe must still confirm;unverifiableanswer, not close (fails without the restart guard).tc:web, oxlint and oxfmt are clean;check:changedpasses 32/32 on the branch.Performance
None — the change is in the confirmation decision, not the probe; no extra RPCs.
Risk
Level: Low
The riskiest part is that a local pane whose process table is genuinely unreadable now closes silently instead of asking — that is the intended trade, and it matches what the tab-close guard does for an unverifiable layout-only candidate. A
remoteunverifiable still prompts, and a pane restarted mid-probe is treated as unknown rather than trusted, so the only newly-silent case is one the local window could not inspect and would only have prompted about anyway. Backout is a plain revert.AI Disclosure
Written with Claude Code.
Review
Self-reviewed against the failure mode: the false prompt was reproduced in a test before the fix, and the same test passes after it; the remote, live and restarted cases are asserted so the relaxation cannot hide a real busy pane.
Agent skill upstream boundary
Notes
Cross-platform: the verdict paths are host-agnostic; the change only affects which verdicts trigger the dialog.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)🤖 Generated with Claude Code