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
feat(updater): tell remote clients which chats and terminals an update restart stops - #51246
Before a phone restarts someone's desktop Orca to update it, the phone should be able to say exactly what the restart will stop. This adds a host read that answers that question, and only lists things that really stop. Terminals and most chats keep running through an update.
Files
Added
Deleted
Net
Test
0
0
0
0
Prod
8
$\color{#1a7f37}{\Huge{\mathbf{+}}}$89
$\color{#cf222e}{\Huge{\mathbf{−}}}$10
$\color{#1a7f37}{\Huge{\mathbf{+}}}$79
What Changed
Before: nothing reported what an update restart interrupts.
status.get gives live tab and pane counts, and agent.list and terminal.list list everything.
On macOS and Linux nearly all of it survives a restart: daemon terminals do, and so do chats handed to the terminal daemon. Listing everything as "will stop" would be wrong.
After:updater.restartImpact returns:
chats: the loaded chats whose agent quit would stop instead of handing it to the terminal daemon. That is every running chat on Windows, and chats whose agent isn't relayed elsewhere. Each has sessionId, agent, worktreeId and the tab's shown name.
terminalPtyIds: terminals whose shell lives in the app because the terminal daemon wasn't available. Clients match these against the terminal.list rows they already hold.
Mechanism:
Quit's keep-or-stop rule for chats moves into one function, quitKeepsStructuredAgent. Quit (detachKeptAgentUnderSerialize) and the new read both use it, so they can't disagree.
The read is synchronous and in memory: one pass over loaded chats and in-process PTY keys, with no listings or probes.
Why
A phone's update confirm needs to name what the restart will interrupt, so the user can decide.
Why reuse quit's own rule: the answer stays truthful as the relay rules change. A second copy would drift.
Why return pty ids instead of full terminal rows: building rows means listing every terminal, and that listing probes each terminal's foreground process. That's work the phone has already done for its own terminal list.
Alternatives rejected:
A field on updater.getStatus: it's polled twice a second during an update.
Filtering agent.list: its worktree listing probes every terminal, and a chat's pane key isn't its session id.
Linked Issue
No GitHub issue; host groundwork for the phone "Update host" confirm. Builds on #51245 (merged).
Visual Proof
N/A, no UI. The read was called on a real packaged macOS build with a daemon terminal open before a real update: {"chats":[],"terminalPtyIds":[]}. After the restart that terminal was still connected with the same pty id, so "nothing stops" was the truthful answer.
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
macOS, packaged build:updater.restartImpact before a real update returned empty while a daemon terminal was open. That terminal survived the update with the same pty id.
Shared rule: quit's keep-or-stop decision is the same code path for quit and for the read. The extraction was reviewed as behaviour-identical.
Gate:pnpm check:changed passes, and the RPC params catalog is regenerated.
Not run: Windows, where every loaded chat should be listed. That path is the same predicate, which returns false there via providerRelayMayKeep.
No automated test: the inputs are live relay and PTY state that only exists in a running app.
Performance
None, because the read runs only when a client asks. It is O(loaded chats + in-process PTYs) in memory, with no listing, subprocess, daemon request or file read. With nothing to stop it does no record lookups.
Risk
Level: Low
New read-only RPC. Not on the phone allowlist yet; the phone UI PR adds it.
The riskiest part is the extraction in detachKeptAgentUnderSerialize. If it were wrong, quit could stop a chat it should keep, or the reverse.
Back out: a plain revert.
AI Disclosure
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
Older hosts answer method_not_found. A client should then fall back to a generic "Orca will restart" confirm.
Known gaps, each only a moment long:
A chat that is still starting isn't listed.
A PTY still spawning isn't listed.
A kept chat whose daemon hand-off fails at quit would still stop.
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)
The change adds a workspace RPC that reports chats and in-process terminal PTYs affected by restart. It updates agent quit-retention checks and makes install triggers explicit, including a remote trigger. Non-manual installs prepare the renderer before installation. Remote host update modules move to shared paths, where updater errors retain their status for coordinator and renderer handling.
Merge Risk: Moderate · up to 85a21 · assessed changes only
Path filters excluded changed files. This rating applies only to the assessed changes.
A remote-triggered update on macOS that has to wait for the installer may restart the app without first checkpointing renderer state, which could lose unsaved work. Make the deferred install keep its trigger and run the same checkpoint as the immediate path before merging.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the primary change: a new read that tells remote clients which chats and terminals an update restart would stop. The raw summary confirms this matches the added updater.restartImpact R…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description is mostly complete and follows the template. It has a clear ELI5, a detailed What Changed section that covers the before and after and the mechanism, a Why section with rejected altern…
Full details: Title check
Explanation
The title names the primary change: a new read that tells remote clients which chats and terminals an update restart would stop. The raw summary confirms this matches the added updater.restartImpact RPC, readUpdateRestartImpact, and the chat-stop predicate. The title is specific, under 100 characters, and does not use vague terms. The changeset also contains broader groundwork (moving the install coordinator to shared code, renaming install preparation, and the quit-keep extraction), which the title does not mention, but that is expected for a title.
Full details: Description check
Explanation
The description is mostly complete and follows the template. It has a clear ELI5, a detailed What Changed section that covers the before and after and the mechanism, a Why section with rejected alternatives, Testing with manual macOS verification, a Performance line that names the reasoning, and a Risk section with level and back-out path. It also lists known gaps and fallback behavior for older hosts. Gaps: the Linked Issue section has no issue number, and it says no GitHub issue exists, so the template's requirement for an actual linked issue is not met for an outside contributor. The Visual Proof section uses N/A with a reason, which is acceptable. The AI Disclosure section is empty. The unchecked items are lint/typecheck/test/build, which the author says CodeRabbit CI covers, and the test-anti-pattern checkbox, which is unchecked while the author says no automated test was added.
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; 0 remain after this review.
…ld stop
Adds updater.restartImpact so a remote client's restart confirm can name what
the update would end. It reuses quit's own keep-or-stop rule for chats (now
one function) and lists only in-process terminals; daemon terminals and
relayed chats keep running and are left out.
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
Before a phone restarts someone's desktop Orca to update it, the phone should be able to say exactly what the restart will stop. This adds a host read that answers that question, and only lists things that really stop. Terminals and most chats keep running through an update.
What Changed
status.getgives live tab and pane counts, andagent.listandterminal.listlist everything.updater.restartImpactreturns:chats: the loaded chats whose agent quit would stop instead of handing it to the terminal daemon. That is every running chat on Windows, and chats whose agent isn't relayed elsewhere. Each hassessionId,agent,worktreeIdand the tab's shown name.terminalPtyIds: terminals whose shell lives in the app because the terminal daemon wasn't available. Clients match these against theterminal.listrows they already hold.quitKeepsStructuredAgent. Quit (detachKeptAgentUnderSerialize) and the new read both use it, so they can't disagree.Why
updater.getStatus: it's polled twice a second during an update.agent.list: its worktree listing probes every terminal, and a chat's pane key isn't its session id.Linked Issue
No GitHub issue; host groundwork for the phone "Update host" confirm. Builds on #51245 (merged).
Visual Proof
N/A, no UI. The read was called on a real packaged macOS build with a daemon terminal open before a real update:
{"chats":[],"terminalPtyIds":[]}. After the restart that terminal was still connected with the same pty id, so "nothing stops" was the truthful answer.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
macOS, packaged build:
updater.restartImpactbefore a real update returned empty while a daemon terminal was open. That terminal survived the update with the same pty id.Shared rule: quit's keep-or-stop decision is the same code path for quit and for the read. The extraction was reviewed as behaviour-identical.
Gate:
pnpm check:changedpasses, and the RPC params catalog is regenerated.Not run: Windows, where every loaded chat should be listed. That path is the same predicate, which returns false there via
providerRelayMayKeep.No automated test: the inputs are live relay and PTY state that only exists in a running app.
Performance
None, because the read runs only when a client asks. It is O(loaded chats + in-process PTYs) in memory, with no listing, subprocess, daemon request or file read. With nothing to stop it does no record lookups.
Risk
Level: Low
detachKeptAgentUnderSerialize. If it were wrong, quit could stop a chat it should keep, or the reverse.AI Disclosure
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
method_not_found. A client should then fall back to a generic "Orca will restart" confirm.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)