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): skip the local-work Close Window prompt when running-work confirmations are off - #49922
If you told Orca not to ask before closing a running chat or terminal, closing the whole window no longer asks about work on your own machine either. It still asks when a remote SSH machine has running work, or when Orca can't reach that machine to check.
What Changed
assessWindowCloseRunningWork (src/renderer/src/components/terminal/tab-lifecycle/window-close-running-work.ts) now treats the "Closing a running chat or terminal" opt-out (skipCloseTerminalWithRunningProcessConfirm) the same way it already treats quit.
Before: with the setting off, closing a tab or pane skipped the prompt, but closing the window still showed "Close Window? There is running work in chats or terminals." for local terminals and chats.
Mechanism: one remoteWorkOnly = isQuitting || skipCloseTerminalWithRunningProcessConfirm === true flag now drives both the SSH-only probe filter and the hasRunningChat() gate, which were previously keyed only on isQuitting. With the setting on, nothing changes.
Why
The setting already covers closing tabs and panes (running-terminal-close-guard, use-terminal-pane-close-actions, workspace-tab-close-commands). Window close was the one path that ignored it.
The first version of this PR skipped the dialog completely when the setting was off. That would have hidden live SSH work, which can die after the relay's detach grace period. The setting means "I accept that closing kills my local processes", not "I accept losing remote work". Reusing the existing quit rule (#524) keeps the remote warning and avoids adding a second toggle for the same question.
N/A. The only visible difference is that the "Close Window?" dialog no longer opens for local running work when the setting is off. There's no new UI, and nothing was captured for this PR.
Testing
Original fix (Linux, desktop, no SSH): turned off Settings → General → Confirmations → "Closing a running chat or terminal", started a long command and an agent, closed the window, and it closed without the prompt. With the setting back on, the prompt appeared as before.
Rework: reasoned through each case against the probe and chat gates. Setting on: the window-close path is unchanged. Setting off with local work only: nothing is probed and no dialog opens. Setting off with SSH PTYs: only the SSH PTYs are probed, and live or unverifiable work still prompts. Quit: unchanged.
Static gates on the touched file all pass: oxlint, oxfmt, the anti-slop and code-quality oxlint configs, ast-grep, and the changed-code quality check.
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
No unit test was added. A test for this would have to mock the store, the PTY probe, session ownership and the chat status feed, and then assert on mock calls. That's wiring glue, which the test rules forbid.
Performance
None, because this runs once per user-initiated window close, not on a hot path. It adds one settings read. With the setting off, it probes fewer PTYs and skips the chat scan. In a benchmark with 200 tabs (1 in 4 over SSH), an opt-out window close probed 200 PTYs on main and 50 with this change, and 0 when no PTYs are SSH. No new sync I/O, subprocesses or polling.
Risk
Level: Low
Users who turned the setting off will no longer see the window prompt for local running work, so closing the window ends that work without asking. That matches what the setting already does for tabs and panes. Remote SSH work still prompts. Default users (setting on) see no change. Back it out with a plain revert.
Review
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
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
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)
No actionable comments were generated in the recent review.
Walkthrough
When quitting or when skipCloseTerminalWithRunningProcessConfirm is true, assessWindowCloseRunningWork probes only SSH PTYs and excludes running chat sessions from its running-work check. Remote unverifiable probes can still return unverifiable.
Severity of issue fixed: Medium
Merge Risk: Minimal · up to bedcc
Closing a window now respects the "Closing a running chat or terminal" setting for local work, while remote SSH work still prompts. No merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Linked Issues check
[#49921] requires that, with "Closing a running chat or terminal" off, closing the window does not show the "Close Window?" prompt for running work, as tab and pane closes already do. At head, assessW…
Out of Scope Changes check
The whole-PR diff (merge base 4e7cb5b to head bedcccf) changes one file, window-close-running-work.ts. It adds a remoteWorkOnly flag that reads the setting named in the issue, reuses it in the candida…
Title check
The title names the main change: with the "Closing a running chat or terminal" confirmation turned off, the window-close prompt is skipped for local running work. It matches the raw summary, which say…
Description check
The description follows the repository template and fills in every required section: ELI5, What Changed, Why, Linked Issue (Fixes #49921), Visual Proof (N/A with reason), Testing, Performance (None, b…
Full details: Linked Issues check
Explanation
[#49921] requires that, with "Closing a running chat or terminal" off, closing the window does not show the "Close Window?" prompt for running work, as tab and pane closes already do. At head, assessWindowCloseRunningWork computes remoteWorkOnly = isQuitting || settings.skipCloseTerminalWithRunningProcessConfirm === true. When remoteWorkOnly is true, only SSH PTYs are probed and hasRunningChat() is skipped. Local live PTYs and running chats therefore no longer return { kind: 'running' } when the setting is off, which meets the issue's expected behavior for the reported Linux local case. Remote SSH PTYs with a 'live' verdict still return running when the setting is off. This is intentional and is stated in the PR objectives and commit message, and the issue does not explicitly cover remote work. The 'unverifiable' branch is unchanged. The PR description says the window-close prompt is skipped for local work, which matches the code. No automated test was added. The author reports only manual Linux desktop testing. No SSH behavior was tested.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff (merge base 4e7cb5b to head bedcccf) changes one file, window-close-running-work.ts. It adds a remoteWorkOnly flag that reads the setting named in the issue, reuses it in the candidate filter and the running-chat check, and updates the function's doc comment. The parameters, return type, probe timeout, and unverifiable branch are unchanged. The change does not touch unrelated code. The remote-SSH retention of prompts is a deliberate, documented behavior and is part of the same condition, not an unrelated change.
Full details: Title check
Explanation
The title names the main change: with the "Closing a running chat or terminal" confirmation turned off, the window-close prompt is skipped for local running work. It matches the raw summary, which says quit or the skip setting now limits probing to SSH PTYs and drops the running-chat check, and it matches the linked issue #49921 and the PR objectives. The title is 94 characters, which is a little long but still a single clear sentence.
Full details: Description check
Explanation
The description follows the repository template and fills in every required section: ELI5, What Changed, Why, Linked Issue (Fixes #49921), Visual Proof (N/A with reason), Testing, Performance (None, because ...), Risk (Level: Low, with a revert plan), Agent skill upstream boundary, Notes, and Checklist. The Testing section gives manual steps for Linux without SSH and states that SSH and other platforms were not manually tested. The AI Disclosure section is blank, but the template says to skip it for internal contributors, so this is not a gap. The Review section is an empty heading. These gaps are minor, so the check 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; 9 remain after this review.
…ork confirmations are off
With "Closing a running chat or terminal" turned off, window close now
treats local PTYs and chats as consented, the same way quit does (stablyai#524).
It still probes SSH relay PTYs, so live or unverifiable remote work keeps
prompting (stablyai#18593). Nothing is probed when there are no SSH PTYs.
Fixesstablyai#49921
Co-authored-by: sasha <[email protected]>
nwparker
changed the title
fix(terminal): skip the Close Window prompt when running-work confirmations are off
fix(terminal): skip the local-work Close Window prompt when running-work confirmations are off
Nov 26, 2026
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
If you told Orca not to ask before closing a running chat or terminal, closing the whole window no longer asks about work on your own machine either. It still asks when a remote SSH machine has running work, or when Orca can't reach that machine to check.
What Changed
assessWindowCloseRunningWork(src/renderer/src/components/terminal/tab-lifecycle/window-close-running-work.ts) now treats the "Closing a running chat or terminal" opt-out (skipCloseTerminalWithRunningProcessConfirm) the same way it already treats quit.remoteWorkOnly = isQuitting || skipCloseTerminalWithRunningProcessConfirm === trueflag now drives both the SSH-only probe filter and thehasRunningChat()gate, which were previously keyed only onisQuitting. With the setting on, nothing changes.Why
The setting already covers closing tabs and panes (
running-terminal-close-guard,use-terminal-pane-close-actions,workspace-tab-close-commands). Window close was the one path that ignored it.The first version of this PR skipped the dialog completely when the setting was off. That would have hidden live SSH work, which can die after the relay's detach grace period. The setting means "I accept that closing kills my local processes", not "I accept losing remote work". Reusing the existing quit rule (#524) keeps the remote warning and avoids adding a second toggle for the same question.
Linked Issue
Fixes #49921
Visual Proof
N/A. The only visible difference is that the "Close Window?" dialog no longer opens for local running work when the setting is off. There's no new UI, and nothing was captured for this PR.
Testing
Original fix (Linux, desktop, no SSH): turned off Settings → General → Confirmations → "Closing a running chat or terminal", started a long command and an agent, closed the window, and it closed without the prompt. With the setting back on, the prompt appeared as before.
Rework: reasoned through each case against the probe and chat gates. Setting on: the window-close path is unchanged. Setting off with local work only: nothing is probed and no dialog opens. Setting off with SSH PTYs: only the SSH PTYs are probed, and live or unverifiable work still prompts. Quit: unchanged.
Static gates on the touched file all pass: oxlint, oxfmt, the anti-slop and code-quality oxlint configs, ast-grep, and the changed-code quality check.
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
No unit test was added. A test for this would have to mock the store, the PTY probe, session ownership and the chat status feed, and then assert on mock calls. That's wiring glue, which the test rules forbid.
Performance
None, because this runs once per user-initiated window close, not on a hot path. It adds one settings read. With the setting off, it probes fewer PTYs and skips the chat scan. In a benchmark with 200 tabs (1 in 4 over SSH), an opt-out window close probed 200 PTYs on main and 50 with this change, and 0 when no PTYs are SSH. No new sync I/O, subprocesses or polling.
Risk
Level: Low
Users who turned the setting off will no longer see the window prompt for local running work, so closing the window ends that work without asking. That matches what the setting already does for tabs and panes. Remote SSH work still prompts. Default users (setting on) see no change. Back it out with a plain revert.
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)