Skip to content

feat(updater): tell remote clients which chats and terminals an update restart stops - #51246

Merged
AmoabaKelvin merged 3 commits into
mainfrom
feat/update-restart-impact
Nov 28, 2026
Merged

AmoabaKelvin merged 3 commits into
mainfrom
feat/update-restart-impact

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

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.

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)

@AmoabaKelvin
AmoabaKelvin changed the base branch from fix/remote-update-install-prep to main November 27, 2026 23:49
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed 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.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8b1faca0-1b55-4a9d-91da-45531c558931
Commits

Reviewing files that changed from the base of the PR and between 2a929a3 and 85a217b.

Files ignored due to path filters: 1

  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 34

  • src/main/ipc/pty/provider/kill-all.ts
  • src/main/native-chat/agent-session-wire/host/structured-agent-session-conversation-reads.ts
  • src/main/native-chat/agent-session-wire/termination/structured-agent-session-host-lifetime.ts
  • src/main/native-chat/agent-session-wire/termination/structured-agent-session-quit-keeps-agent.ts
  • src/main/runtime/hosts/management/update-restart-impact.ts
  • src/main/runtime/rpc/methods/updater/updater.ts
  • src/main/updater/lifecycle/updater-download-install.ts
  • src/main/updater/lifecycle/updater-install-execution.ts
  • src/main/updater/lifecycle/updater-install-support.ts
  • src/main/updater/lifecycle/updater-remote-status.ts
  • src/main/updater/lifecycle/updater-required-restart.ts
  • src/main/updater/lifecycle/updater-setup.ts
  • src/main/updater/lifecycle/updater-state.ts
  • src/main/updater/updater-service.ts
  • src/main/window/renderer-relays/native-unload-coordinator.ts
  • src/renderer/src/components/bots/BotComputerPicker.fixture.tsx
  • src/renderer/src/components/settings/runtime-environments/RuntimeServersSection.fixture.tsx
  • src/renderer/src/components/settings/runtime-environments/server-rows/runtime-server-list.tsx
  • src/renderer/src/components/settings/runtime-environments/server-rows/runtime-server-row-details.tsx
  • src/renderer/src/components/settings/runtime-environments/server-rows/runtime-server-row-meta.ts
  • src/renderer/src/components/settings/runtime-environments/server-rows/runtime-server-row-presentation.ts
  • src/renderer/src/components/settings/runtime-environments/server-rows/runtime-server-row.tsx
  • src/renderer/src/components/settings/runtime-environments/updates/RemoteServerUpdateDialog.tsx
  • src/renderer/src/components/settings/runtime-environments/updates/RemoteServerUpdateStatus.tsx
  • src/renderer/src/components/settings/updates/GeneralRemoteServerUpdates.tsx
  • src/renderer/src/runtime/hosts/updates/remote-server-update-batch.ts
  • src/renderer/src/runtime/hosts/updates/remote-server-update-errors.ts
  • src/renderer/src/store/slices/runtime-host-updates/remote-server-updates.ts
  • src/shared/remote-runtime/host-catalog/remote-server-update.ts
  • src/shared/remote-runtime/host-updates/remote-server-install-failure-probe.ts
  • src/shared/remote-runtime/host-updates/remote-server-restart-wait.ts
  • src/shared/remote-runtime/host-updates/remote-server-update-coordinator.ts
  • src/shared/remote-runtime/host-updates/remote-server-updater-polling.ts
  • src/shared/remote-runtime/host-updates/remote-server-version-skew.ts

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant