Skip to content

Add opt-in automatic desktop updates - #44541

Merged
nwparker merged 3 commits into
mainfrom
nwparker/add-opt-in-fully-automatic-update-auto-download
Nov 19, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/add-opt-in-fully-automatic-update-auto-download

Conversation

@nwparker

@nwparker nwparker commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add an opt-in Automatic updates switch in Settings → General → About. Eligible releases follow the configured check cadence, release channel, and update delay. Orca downloads the update, checkpoints the window, installs silently, and relaunches on its own. The switch defaults to off. An info icon explains the behavior and toasts show download and installation progress.

The restart checkpoint flushes pending editor input and backs up drafts. Orca holds automatic installation if it would terminate a live or launching in-process terminal, if a WSL move is active, or if the renderer cannot save its state.

Orca-managed SSH and WSL hosts pick up the bundled version through their existing guarded reconnect paths. A paired desktop uses its own preference and reports that it is busy when another download or install owns the updater. Standalone orca serve uses the explicit server update flow.

Fixes #5974

Visual proof

Captured in a hidden macOS Electron instance at 1280 × 820. The Settings interaction used the real preference write. The app received fixture updater statuses over IPC for the toast and recovery screenshots. The paired desktop used a fixture RPC response.

Settings and info icon
Before · About After · Switch and info icon
About before Automatic updates defaults to off

The info icon explains when Orca updates and restarts

Automatic download, silent install, and recovery
Before · Manual download After · Background download toast
Manual download at 42 percent Background download toast and progress in the status bar
Before · Restart action After · Automatic install toast
Previous restart prompt Orca is installing and will restart automatically

Orca stays open with a retry action when the window checkpoint fails

Paired desktop already updating
Before · The client keeps checking After · The host reports it is busy
The original client keeps checking The dialog reports the host is already updating

Verification

  • Three adversarial reviewers covered installer lifecycle, renderer checkpointing, and settings and remote behavior.
  • 98 focused tests passed across 16 updater, checkpoint, editor, and remote-update test files.
  • The Electron run verified the info tooltip, preference persistence, download and install toasts, and the failure card. It also verified that the renderer acknowledges the restart checkpoint, holds input, and restores it on cancellation.
  • A signed installer run and a live remote restart remain unverified.

Risk

Medium. The preference allows Orca to relaunch as soon as an eligible update is ready. Existing installer preflight and the renderer checkpoint can defer that restart to protect active work.

  • Self-reviewed for correctness, compatibility, and performance.
  • No upstream agent-skill source or fixtures were copied.
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​285 $\color{#cf222e}{\Huge{\mathbf{−}}}$​7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​278
Prod 40 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​623 $\color{#cf222e}{\Huge{\mathbf{−}}}$​89 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​534

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

The pull request adds an opt-in automatic-updates setting and connects it to desktop update checks, downloads, and installation. The updater marks automatic downloads in update statuses and monitors macOS installer staging. Before an automatic install, it checks terminal activity and prepares the renderer. The renderer can block preparation when unsaved changes exist. The update interface adds automatic-download and installation states, toasts, and settings controls. Tests cover download and install lifecycle conditions, renderer preparation, and macOS staging.

Severity of issue fixed: Medium

Merge Risk: Moderate · up to 6160c

With automatic updates on, a stalled macOS update on a headless serve host can leave the app window unresponsive to close and reload until Orca restarts. A few earlier concerns also remain open, covering pinned-build handling for paired desktops, install timing, and the durability of edits made right before an install. Resolve these before merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Add opt-in automatic desktop updates" matches the main change: an opt-in Automatic updates setting that downloads and installs updates automatically on supported desktop installs. It is sho…
Linked Issues check Passed Only #5974 is directly linked and open, so its acceptance criteria apply. The whole-PR summary (merge base 282844f to head 6160c77) shows the following implementation:

- Persistent toggle [#5974]: …
Out of Scope Changes check Passed Each changed area maps to #5974 or supports its install path:

- Settings: settings.ts, global-settings-types.ts, AutomaticUpdatesSetting.tsx, automatic-updates-copy.ts, general-search.ts, SettingsFor…
Description check Passed The description is mostly complete. It has a Summary that explains the opt-in Automatic updates switch, the restart checkpoint, the install holds, and the SSH, WSL, paired desktop, and orca serve path…
Full details: Title check

Explanation

The title "Add opt-in automatic desktop updates" matches the main change: an opt-in Automatic updates setting that downloads and installs updates automatically on supported desktop installs. It is short, specific, and states the primary feature.

Full details: Linked Issues check

Explanation

Only #5974 is directly linked and open, so its acceptance criteria apply. The whole-PR summary (merge base 282844f to head 6160c77) shows the following implementation:

  • Persistent toggle [#5974]: AutomaticUpdatesSetting.tsx adds a searchable switch. GlobalSettings gains automaticUpdates?: boolean. settings.ts forwards changes to applyAutomaticUpdatesSetting, which the store persists.
  • Automatic download when enabled [#5974]: canDownloadAutomatically() gates downloadAvailableUpdateAutomatically(). The gate requires a packaged app, enabled automatic updates, autoInstallOnAppQuit, a matching offer, and the release source.
  • Install without a manual Restart click [#5974]: a matching downloaded update sets installing and triggers quitAndInstall(automatic). Before install, prepareRendererForUpdate saves renderer state, and performQuitAndInstall invokes the native updater only after prepareAutomaticInstall succeeds.
  • Manual mode when off [#5974]: the default is off. canDownloadAutomatically() returns false, so offers stay manual.
  • No forced interruption [#5974]: canProceedWithInstall holds automatic installs for live or launching in-process terminals (hasInProcessTerminalSessions), for an active WSL move, and for a failed renderer checkpoint. A failed checkpoint shows a retryable install failure. Input is held and restored on cancellation.
  • macOS readiness and prerelease handling [#5974]: watchMacStaging and a staging timeout cover Squirrel.Mac readiness. Automatic offers exclude pinned and fallback builds.

The issue allows install on quit or after a grace period. The PR installs after an eligible download, subject to these holds. This satisfies the issue requirement. Linux and Windows behavior and a signed installer run are not separately verified. These are verification gaps, not missing coding requirements.

Full details: Out of Scope Changes check

Explanation

Each changed area maps to #5974 or supports its install path:

  • Settings: settings.ts, global-settings-types.ts, AutomaticUpdatesSetting.tsx, automatic-updates-copy.ts, general-search.ts, SettingsFormControls.tsx, locale files.
  • Updater lifecycle: updater-download-install.ts, updater-setup.ts, updater-state.ts, updater-status.ts, updater-events.ts, updater-scheduling.ts, updater-menu-checks.ts, updater-install-execution.ts, updater-install-support.ts.
  • Renderer status and UI: UpdateCard, UpdateCardStateContent, update-card-visibility.ts, ui-slice-update-actions.ts, updater-status-ipc-bridge.ts, updater-message-copy.ts, updater-failure-copy.ts.
  • Checkpoint path: native-unload-coordinator.ts and tests, renderer-runtime.ts, renderer-restart-wiring.ts, renderer-restart-preparation.ts, main-window-close-lifecycle.ts, use-settings-page-effects.ts, updater-renderer-events.ts. These implement the renderer checkpoint and input hold that the install path requires.
  • Editor flush: editor-restart-save-handlers.ts and its autosave test. These implement the pending-input flush the PR description specifies.
  • Terminal check: kill-all.ts (hasInProcessTerminalSessions). This implements the in-process terminal hold.
  • Remote paths: updater-remote-status.ts and the remote-server polling and coordinator changes. The PR description ties these to the paired desktop case and the busy-state reporting. The issue does not name them. The connection is concrete, so this is related scope, not unrelated work.

No change is shown to be unrelated to #5974 or to the PR description.

Full details: Description check

Explanation

The description is mostly complete. It has a Summary that explains the opt-in Automatic updates switch, the restart checkpoint, the install holds, and the SSH, WSL, paired desktop, and orca serve paths. It includes Visual proof with before and after screenshots for the settings, download, install, recovery, and paired desktop flows. It has a Verification section and a Risk section with a Medium level and a self-review checkbox. Several template sections are missing or incomplete. The ELI5, What Changed, and Why sections are absent as separate headings. The Linked Issue section uses 'Fixes #5974', which is a valid link. The Testing section lacks the template checkboxes and the list of platforms actually tested. The Risk section does not say how to back out the change (revert or what a revert would not undo). The AI Disclosure and Review sections are missing. The Agent skill upstream boundary section is only partly addressed in the description, and the Notes checklist is not filled in. The Checklist items for lint, typecheck, test, and build are not confirmed. The description does not name the platforms tested. It mentions macOS only for the visual proof.

  • 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: 594b0c68-1ca7-4204-bfd9-c5dadb6fde68
Commits

Reviewing files that changed from the base of the PR and between f44d886 and 686c5a6.

Files selected for processing: 30

  • src/main/ipc/settings/settings.ts
  • src/main/updater/lifecycle/main-window-updater.ts
  • src/main/updater/lifecycle/updater-automatic-download.test.ts
  • src/main/updater/lifecycle/updater-download-install.ts
  • src/main/updater/lifecycle/updater-menu-checks.ts
  • src/main/updater/lifecycle/updater-remote-status.ts
  • src/main/updater/lifecycle/updater-scheduling.ts
  • src/main/updater/lifecycle/updater-setup.ts
  • src/main/updater/lifecycle/updater-state.ts
  • src/main/updater/lifecycle/updater-status.ts
  • src/main/updater/releases/updater-fallback.ts
  • src/main/updater/updater-events.test.ts
  • src/main/updater/updater-events.ts
  • src/main/updater/updater-handler-context.ts
  • src/main/updater/updater-service.ts
  • src/renderer/src/components/maintenance/update-card/UpdateCard.tsx
  • src/renderer/src/components/maintenance/update-card/UpdateCardStateContent.tsx
  • src/renderer/src/components/maintenance/update-card/UpdateDownloadCardContent.tsx
  • src/renderer/src/components/maintenance/update-card/update-card-visibility.ts
  • src/renderer/src/components/settings/general/general-search.ts
  • src/renderer/src/components/settings/updates/AutomaticUpdatesSetting.tsx
  • src/renderer/src/components/settings/updates/GeneralUpdateSettingsSection.tsx
  • src/renderer/src/components/settings/updates/automatic-updates-copy.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/runtime/hosts/updates/remote-server-update-coordinator.test.ts
  • src/renderer/src/runtime/hosts/updates/remote-server-update-coordinator.ts
  • src/renderer/src/runtime/hosts/updates/remote-server-updater-polling.ts
  • src/renderer/src/store/slices/ui/ui-slice-update-actions.ts
  • src/shared/settings/global-settings-types.ts
  • src/shared/updater/update-status-types.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

}
}
)
} else if (offer.state !== 'downloaded') {

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.

Major · Functional Correctness · Heavy lift

Validate the pinned build before installing a staged update.

When targetTag requests an exact build, the remote check can return a staged offer for a different version. Two states show this. A downloaded offer with automaticDownload set skips the pin path in updater-menu-checks.ts:14. A downloading offer returns from the same early check. The coordinator then installs the staged build at remote-server-update-coordinator.ts:267-271 and reports updated for it.

Require the installed target to match the pinned build before transport.install runs. Reject or re-check a mismatching offer. Keep the path for a matching staged offer unchanged.

@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: 3

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: 61ef8c05-7d74-4896-a306-aabd23b9cbad
Commits

Reviewing files that changed from the base of the PR and between 686c5a6 and aab9e69.

Files selected for processing: 19

  • src/main/updater/lifecycle/updater-automatic-download.test.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-setup.ts
  • src/main/updater/lifecycle/updater-state.ts
  • src/main/window/renderer-relays/native-unload-coordinator.test.ts
  • src/main/window/renderer-relays/native-unload-coordinator.ts
  • src/preload/renderer/renderer-runtime.ts
  • src/renderer/src/app-shell/updates/updater-message-copy.ts
  • src/renderer/src/components/maintenance/update-card/UpdateCardStateContent.tsx
  • src/renderer/src/components/settings/updates/AutomaticUpdatesSetting.tsx
  • src/renderer/src/components/settings/updates/GeneralUpdateSettingsSection.tsx
  • src/renderer/src/components/settings/updates/automatic-updates-copy.ts
  • src/renderer/src/hooks/ipc-events/native-app/updater-status-ipc-bridge.ts
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/store/slices/ui/ui-slice-update-actions.ts
  • src/shared/updater/updater-failure-copy.ts
Files with no reviewable changes: 1

  • src/renderer/src/components/maintenance/update-card/UpdateCardStateContent.tsx
Files skipped from review as they are similar to previous changes: 2

  • src/renderer/src/components/settings/updates/automatic-updates-copy.ts
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.


finishCheckpoint(() => {})
await vi.advanceTimersByTimeAsync(0)
expect(autoUpdater.quitAndInstall).toHaveBeenCalledWith(true, true)

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.

Major · Functional Correctness · Heavy lift

Reconcile automatic installation with the "install on next quit" contract.

With automatic updates on, the download handler calls quitAndInstall(true) as soon as the download completes. After the renderer checkpoint resolves, the app quits and installs without a user action. The PR summary and linked issue #5974 describe installation on the next quit, or after a user-confirmed restart prompt, without forced interruption of active work. This test asserts the immediate restart, so it fixes the conflicting behavior in place.

Decide which contract applies. If installation must wait for quit or user confirmation, gate the automatic quitAndInstall call on that event and update this test to expect no native install before it. If an immediate restart is intended, update the PR description and this test's title to say so.

const automatic = this.getAutomaticUpdates?.() === true
this.sendStatus(automatic ? { ...status, installing: true } : status, { force: true })
if (automatic) {
this.quitAndInstall(true)

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.

Major · Functional Correctness · Quick win

Keep automatic downloads ready until the user quits or selects restart.

When an automatic download completes, this call schedules installation immediately. The install path then invokes the native installer and releases terminal sessions without a user restart action. This contradicts the stated next-quit behavior and interrupts active work.

Publish the ready status without installing: true. Keep installation on quit and the explicit restart action.

private async prepareAutomaticInstall(version: string): Promise<boolean> {
const window = this.getMainWindow()
if (window && !window.isDestroyed() && !window.webContents.isDestroyed()) {
this.cancelAutomaticInstallPreparation = await prepareRendererForUpdate(window.webContents)

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.

Major · Data Integrity & Integration · Heavy lift

Re-run the editor save checkpoint before native install, or keep later edits durable.

Preparing for an update does not stop the user from editing. Editor autosave also keeps running after the checkpoint. On the native install path, nothing saves edits made after the checkpoint. Two cases can lose them:

  • A dirty file whose autosave is suspended, such as a non-UTF-8 pause or an external-change conflict, is never autosaved after the checkpoint.
  • Any edit still inside the autosave debounce when native invocation starts is not written before the app exits.

The automatic path can keep the prepared state until a later quit, which widens the exposure. The install path must either persist all dirty editor state immediately before invoke() runs, or prevent edits to dirty files while the prepared state is held. The fix must cover suspended-autosave files as well as ordinary debounced ones.

@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: 6f6140c3-a25f-492e-95e7-49a05318cb3d
Commits

Reviewing files that changed from the base of the PR and between aab9e69 and 6160c77.

Files selected for processing: 31

  • src/main/ipc/pty/provider/kill-all.ts
  • src/main/updater/lifecycle/updater-automatic-download.test.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-menu-checks.ts
  • src/main/updater/lifecycle/updater-remote-status.ts
  • src/main/updater/lifecycle/updater-scheduling.ts
  • src/main/updater/lifecycle/updater-setup.ts
  • src/main/updater/lifecycle/updater-state.ts
  • src/main/updater/updater-events.test.ts
  • src/main/updater/updater-events.ts
  • src/main/updater/updater-handler-context.ts
  • src/main/window/main-window/main-window-close-lifecycle.ts
  • src/main/window/renderer-relays/native-unload-coordinator.test.ts
  • src/main/window/renderer-relays/native-unload-coordinator.ts
  • src/preload/renderer/renderer-runtime.ts
  • src/preload/renderer/restart/renderer-restart-wiring.ts
  • src/renderer/src/app-shell/updates/updater-message-copy.ts
  • src/renderer/src/components/editor/autosave/editor-autosave-controller.test.ts
  • src/renderer/src/components/editor/autosave/editor-restart-save-handlers.ts
  • src/renderer/src/components/settings/form-controls/SettingsFormControls.tsx
  • src/renderer/src/components/settings/page/use-settings-page-effects.ts
  • src/renderer/src/components/settings/updates/AutomaticUpdatesSetting.tsx
  • src/renderer/src/components/settings/updates/GeneralUpdateSettingsSection.tsx
  • src/renderer/src/components/settings/updates/automatic-updates-copy.ts
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
  • src/shared/app-lifecycle/shutdown/renderer-restart-preparation.ts
  • src/shared/updater/updater-failure-copy.ts
  • src/shared/updater/updater-renderer-events.ts
Files skipped from review as they are similar to previous changes: 4

  • src/renderer/src/components/settings/updates/automatic-updates-copy.ts
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
  • src/shared/updater/updater-failure-copy.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

return
}

if (automatic && !(await this.prepareAutomaticInstall(pendingVersion))) {

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.

Major · Stability & Availability · Heavy lift

Release or bound the renderer hold when deferred macOS staging times out.

With automatic updates on, a supervised serve window can hold its update preparation before the native install starts. On macOS the deferred-staging timeout reports an error but leaves that preparation in place. If staging never completes, the hold stays until a reset or commit path runs. The window can remain inert until Orca restarts.

The fix must keep the native handoff intact, because Squirrel can still install late. Choose the release behavior that matches late installation, and state it in the timeout path.

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.

Add opt-in fully automatic update (auto-download + auto-install)

1 participant