Skip to content

feat(mobile): update the computer's Orca from Edit computer - #51708

Merged
AmoabaKelvin merged 2 commits into
mainfrom
mobile-host-orca-update
Nov 28, 2026
Merged

AmoabaKelvin merged 2 commits into
mainfrom
mobile-host-orca-update

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

Your phone can now update Orca on your computer. Edit computer shows the new version with an Update button. One sheet downloads it, tells you what a restart would stop, restarts Orca only after you confirm, and tells you when the computer is back.

Files Added Deleted Net
Test 0 0 0 0
Prod 18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1301 $\color{#cf222e}{\Huge{\mathbf{−}}}$​213 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1088

What Changed

  • Before: Edit computer showed the computer's Orca version and nothing to act on. A server got a one-line footer ("Update Orca on the server, then restart it").
  • After:
    • Orca row: when the computer's updater offers a version, the row reads installed → latest with Update (only when the computer can update itself from a phone). On open the phone reads updater.getStatus and never starts a check, since a check would also start one on the computer's screen. A computer that has to be updated by hand keeps its steps under the row. With nothing to update it's today's row, plus "Up to date" when the updater says so.
    • Update sheet:
      • Download: follows a download the computer already started, and skips straight to the confirm if it's already downloaded.
      • Will restart: read fresh from updater.restartImpact right before the confirm. Restart stays off until that read lands. With nothing to stop, the list is gone; a host that doesn't say shows a line instead of an empty list.
      • Restart Orca: the restart only happens on this tap.
      • Restarting: Hide keeps the wait going in the background.
      • Back online: "Updated to X", then a toast.
      • Couldn't update: the computer's reason, Details, Try again.
      • Hasn't come back: Check again waits for the same restart without asking for a second one; Try again starts over if the computer came back on its old version.
    • Host screen: while a restart the phone asked for is underway, a line above the page says "Updating to X…", so the reconnect doesn't read as a failure.
  • Host: phones may call updater.getStatus/check/download/install/restartImpact (execution-host routes), advertised as updater.mobile.v1. An install still needs updater.remote-control.v1 and remoteUpdateSupport.automatic.
  • Shared coordinator:
    • runRemoteServerUpdate is split into downloadRemoteServerUpdate (stops at downloaded, resumes from the updater's current state) and installRemoteServerUpdate (install, then wait for the replacement process, or only wait again for an accepted install). Desktop's run composes both and behaves as before.
    • A stalled download no longer republishes the same percent every tick.
    • The restart wait takes one last look after its deadline, so a phone whose timers were paused (locked) doesn't call a computer that's already back "lost".

Why

  • The host-side work already existed (fix(updater): back up unsaved editors before a remote-triggered desktop update #51245 backs up unsaved editors before a remote install; feat(updater): tell remote clients which chats and terminals an update restart stops #51246 names what a restart stops). The phone needed permission, a screen, and a pause between download and install for the confirm, and Kelvin's call was that the phone may restart a desktop only behind that confirm.
  • Splitting the coordinator instead of a "pause before install" callback: a confirm can be minutes later, after the sheet was hidden or the screen left, so holding a paused promise, transport and queue slot open was the wrong shape. Two stages each finish.
  • Status read on open, not a check: a check is user-initiated on the computer and shows there.
  • A store per computer that holds the connection while a stage runs: leaving Edit computer, or hiding the sheet, never drops an update. Removing the computer ends its stage at the next tick.

Linked Issue

No GitHub issue; part of the phone parity work. Builds on #51245 and #51246 (merged).

Visual Proof

A real update between two packaged macOS builds of this branch (A 1.4.214-local.1000… → B …local.2000…, test bundle id, isolated HOME and profile), driven from an iOS 27 simulator. ShipIt swapped the app and relaunched it, and the phone reconnected by itself. The local-build versions are long, so they wrap. A daemon terminal survived, so nothing was listed under "Will restart".

Before Orca row Download Downloading
(screenshot removed: contained real product data) (screenshot removed: contained real product data) (screenshot removed: contained real product data) (screenshot removed: contained real product data)
Confirm Restarting Host screen meanwhile Back online
(screenshot removed: contained real product data) (screenshot removed: contained real product data) (screenshot removed: contained real product data) (screenshot removed: contained real product data)
Toast Light
(screenshot removed: contained real product data) (screenshot removed: contained real product data)

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, real Squirrel/ShipIt update from the phone, run twice: Edit computer → Update → Download → Restart Orca. The app on disk went A → B, the relaunched process reported B, and the phone came back connected and showed "Updated to B".

  • Dev serve (unpackaged): no Update on the row; the support reason's footer shows. Old hosts without updater.mobile.v1 keep today's row.

  • Desktop Settings' server updates still use runRemoteServerUpdate; pnpm tc:web passes and the composed stages make the same calls in the same order.

  • No automated test: the behaviour is a real updater and restart, which the run above exercised.

  • Not run: Windows and Linux desktops (their support.automatic comes from the host as before), and Android.

Performance

None while idle, because nothing runs until the user taps Update: opening Edit computer reads updater.getStatus once and an unchanged answer writes nothing. While a download or restart the user started is underway, the phone polls once a second (10-minute download cap, 3-minute restart cap) with one status read per tick, and publishes only when the percent changes. Removing the computer ends that polling at the next tick.

Risk

Level: High

  • Riskiest part: a phone can now restart a desktop Orca. It does so only after the confirm that names what stops, through the same updater.install path desktop's own remote updates use (which backs up unsaved editors first, fix(updater): back up unsaved editors before a remote-triggered desktop update #51245).
  • Mixed versions: additive. Old hosts don't advertise updater.mobile.v1 and keep today's screen; old phones never call these methods.
  • Phone release: Edit computer is native, so phones get this with the next app release. No native modules change.
  • Back out: a plain revert. Nothing is persisted.

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

  • Servers a phone reaches through its computer, and SSH-managed orcad (managedServer.update on the managing desktop), aren't updated from the phone yet; their notices name the server without an action (next PR).
  • Download size isn't shown: the host reports percent only.
  • Cancel during a download closes the sheet; the computer keeps downloading (there's no cancel), and no restart happens without the confirm.

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 force-pushed the mobile-agent-cli-updates branch from 988e3f7 to 5c93e1a Compare November 28, 2026 10:44
@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-host-orca-update branch from 9230cce to c484216 Compare November 28, 2026 10:44
@AmoabaKelvin
AmoabaKelvin changed the base branch from mobile-agent-cli-updates to main November 28, 2026 10:47
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

The changes add mobile controls for agent CLI and Orca updates, including update status, download and restart flows, failure details, and restart-impact information. They add shared agent CLI update utilities used by the main process and renderer. They also split remote server updates into download and install stages and update the coordinator to use them.

Merge Risk: Low · up to 9abf9

Phone-driven Orca and agent CLI updates work in the reported flows. In rare timing cases an Edit computer row can briefly show a stale Update action, or show "Updated" without a version. A later check corrects it. Fix these before merge or accept them as minor.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(mobile): update the computer's Orca from Edit computer" matches the main change: the phone can update Orca on a host from the Edit computer screen, with download, confirm, restart, and…
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. It has a clear ELI5, a detailed What Changed section with before and after behavior, a Why section that explains the split between download and install and the stat…
Full details: Title check

Explanation

The title "feat(mobile): update the computer's Orca from Edit computer" matches the main change: the phone can update Orca on a host from the Edit computer screen, with download, confirm, restart, and reconnect flow. It is specific and follows a conventional commit style. The title does not mention the agent CLI updates or the shared coordinator split, but those are secondary to the main change.

Full details: Description check

Explanation

The description is mostly complete. It has a clear ELI5, a detailed What Changed section with before and after behavior, a Why section that explains the split between download and install and the status-read-on-open choice, and a Risk section that names the riskiest part and the back-out path. It also has Visual Proof with before and after images, a Testing section with manual macOS steps and an explicit note that no automated tests were added, and a Performance section. Gaps: the Linked Issue section says there is no GitHub issue, which the template says should always exist for outside contributors. The author says this is internal phone-parity work, so the gap may not apply, but the author should confirm. The Testing checklist leaves the anti-pattern test item unchecked, and the lint/typecheck/test/build checklist item is unchecked. The Risk level is set to High, and the AI Disclosure section is empty. The author should confirm whether the AI Disclosure is required for this contributor.

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

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: 3bf177d5-3b4a-4037-b590-8474e5d71af6
Commits

Reviewing files that changed from the base of the PR and between 39bf434 and c484216.

Files selected for processing: 39

  • mobile/app/h/[hostId]/edit.tsx
  • mobile/app/h/[hostId]/index.tsx
  • mobile/src/host-catalog/host-removal-lifecycle.ts
  • mobile/src/host-screen/identity/HostOrcaVersionSection.tsx
  • mobile/src/host-screen/identity/updates/HostAgentCliUpdateFailureSheet.tsx
  • mobile/src/host-screen/identity/updates/HostAgentCliUpdateRow.tsx
  • mobile/src/host-screen/identity/updates/HostOrcaUpdateSheet.tsx
  • mobile/src/host-screen/identity/updates/HostUpdatesSection.tsx
  • mobile/src/host-screen/identity/updates/agent-cli-update-operations.ts
  • mobile/src/host-screen/identity/updates/host-agent-cli-updates.ts
  • mobile/src/host-screen/identity/updates/host-orca-update-operations.ts
  • mobile/src/host-screen/identity/updates/host-orca-update-snapshot.ts
  • mobile/src/host-screen/identity/updates/host-orca-update.ts
  • mobile/src/i18n/en-runtime-required.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/settings/settings-screen-frame.tsx
  • src/main/agent-cli-update/agent-cli-update-service.ts
  • src/main/agent-cli-update/agent-cli-updater-output.test.ts
  • src/main/agent-cli-update/agent-cli-updater-output.ts
  • src/main/runtime/rpc/server/runtime-rpc-mobile-host-update-methods.ts
  • src/main/runtime/rpc/server/runtime-rpc-mobile-method-routing.ts
  • src/main/runtime/rpc/server/runtime-rpc-mobile-orca-account-methods.ts
  • src/renderer/src/components/agent-cli-update/AgentCliUpdateCard.tsx
  • src/renderer/src/components/agent-cli-update/agent-cli-product-name.ts
  • src/renderer/src/components/settings/runtime-environments/updates/RemoteServerUpdateStatus.tsx
  • src/renderer/src/components/status-bar/updates/AgentCliUpdateList.tsx
  • src/renderer/src/components/status-bar/updates/AgentCliUpdateStatusSegment.tsx
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/store/slices/runtime-host-updates/agent-cli-updates.ts
  • src/shared/agent-launch/installation/agent-cli-product-names.ts
  • src/shared/agent-launch/installation/agent-cli-update-runs.ts
  • src/shared/agent-launch/installation/agent-cli-update.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-update-entry.ts
  • src/shared/remote-runtime/host-updates/remote-server-update-stages.ts
  • src/shared/remote-runtime/protocol/host-runtime-capabilities.ts
Files with no reviewable changes: 1

  • mobile/src/host-screen/identity/HostOrcaVersionSection.tsx

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

@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-host-orca-update branch 2 times, most recently from 116189a to 64e408b Compare November 28, 2026 12:17

@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: 2793b223-d90d-4b82-ba9d-56a556cccae2
Commits

Reviewing files that changed from the base of the PR and between 116189a and 64e408b.

Files selected for processing: 6

  • mobile/src/host-catalog/host-removal-lifecycle.ts
  • mobile/src/host-screen/identity/updates/HostUpdatesSection.tsx
  • mobile/src/host-screen/identity/updates/host-agent-cli-updates.ts
  • mobile/src/host-screen/identity/updates/host-orca-update.ts
  • mobile/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/en-runtime-required.json
Files skipped from review as they are similar to previous changes: 1

  • src/renderer/src/i18n/en-runtime-required.json

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

// Reopening Edit computer on an unchanged computer publishes nothing.
write(
hostId,
(update) => (sameSnapshot(update.snapshot, snapshot) ? update : { ...update, snapshot }),

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.

Minor · Functional Correctness · Quick win

Reject snapshot replies that an newer snapshot has superseded.

readHostOrcaUpdate and the download stage's preliminary status read both publish snapshot for the same host owner. Neither checks request order. If an older status request resolves after a newer one has published, the older reply overwrites the newer snapshot. The owner guard does not prevent this, because both requests share the owner. The sameSnapshot check only skips identical values.

The stale snapshot stays in the store until a later read publishes. While it stays, the row can show an outdated installed or offered version. A download started from it also uses that stale version as its target.

Give each snapshot request an order, as refreshHostOrcaRestartImpact already does with impactReads. Publish a result only when its request is newer than the last published snapshot for that host. Keep reads that do not overlap unchanged.

@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-host-orca-update branch from 64e408b to 9abf9b9 Compare November 28, 2026 12:36

@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: 747920f2-ddfe-43a9-992d-d902b28f6220
Commits

Reviewing files that changed from the base of the PR and between 64e408b and 9abf9b9.

Files selected for processing: 1

  • mobile/src/host-screen/identity/updates/host-agent-cli-updates.ts

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

write(hostId, entry, (host) => {
const runs = { ...host.runs }
delete runs[agent]
const latest = host.updates.find((u) => u.agent === agent)?.latestVersion ?? ''

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.

Minor · Functional Correctness · Quick win

Keep the run's target version separate from current offers.

If a check returns after installation finishes but before the successful run reply arrives, it can correctly replace host.updates with []. This line then records done[agent] = '', so the “Updated to” record loses the installed version.

Preserve the target version when the run starts, or return the installed version from the run operation. Do not derive it from the current offers when the reply arrives.

Edit computer's Orca row shows installed -> latest and Update when the
computer can update itself. One sheet downloads the update, names what a
restart stops (updater.restartImpact), restarts Orca only after that
confirm, and waits for the computer to come back on the new version.
Hide keeps the wait going, and a host that hasn't come back can be
checked again without asking for a second restart.

The shared coordinator now has separate download and install stages, so
a client can stop between them; desktop's runRemoteServerUpdate composes
both as before. Hosts let phones call updater.* (updater.mobile.v1).
…test read

Only the newest restart-impact read sets the confirm's list, and a
download that finished as its computer was removed no longer brings that
computer back. Closing the sheet on a finished update leaves it for the
toast that says so.
@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-host-orca-update branch from 9abf9b9 to 13521e3 Compare November 28, 2026 12:46
@AmoabaKelvin
AmoabaKelvin merged commit af49771 into main Nov 28, 2026
58 of 59 checks passed
onegaop pushed a commit to onegaop/orca that referenced this pull request Nov 28, 2026
移植 stablyai/orca stablyai#51707 (c784ff4), stablyai#51708 (af49771) 和 stablyai#51710 (af07771)。适配 fork 的手机图标和 Jira 提示。
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