Skip to content

feat(mobile): update the servers a computer reaches from Edit computer - #52332

Merged
AmoabaKelvin merged 3 commits into
mainfrom
mobile-server-updates
Nov 29, 2026
Merged

AmoabaKelvin merged 3 commits into
mainfrom
mobile-server-updates

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

Edit computer on the phone can now update the servers that computer reaches, not just the computer itself. There are two kinds of server:

  • A server that updates itself (another Orca paired to the computer) opens the same update sheet as the computer.
  • A server the computer installed over SSH is updated by the computer, the same way its own Settings does it. That includes the "Update anyway" question when terminals are running there.
Files Added Deleted Net
Test 0 0 0 0
Prod 32 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1049 $\color{#cf222e}{\Huge{\mathbf{−}}}$​94 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​955

What Changed

Phone (Edit computer → Updates):

  • One row per server that has something to show: an update offered, an update running, or a result. Servers with nothing to update get no row.
  • Self-updating servers: tapping Update opens the existing Orca update sheet (Download → Restart → "Updated to X" → toast). It runs through a client scoped to that server, so the desktop relays updater.* to the runtime: host.
  • SSH-managed servers: tapping Update asks the computer to run managedServer.update.
    • If the computer defers because terminals are running, the phone asks "Update {server} anyway?", in the desktop's own words for counted and uncounted terminals.
    • Update anyway passes pastLiveTerminals, as the desktop does. The update keeps its version checks, unlike force.
    • The row shows Orca versions (the server's → the computer's). Only when those match does it show the server build ids.
  • In-workspace notice: "Update Orca on " now offers How to update, opening Edit computer, but only when a row will be there for that server. That means an SSH-managed server on a computer with managedServer.mobile.v1, or a self-updating server the phone can update through the computer.

Computer:

  • mobileRelay.hosts.list marks SSH-managed servers with managedOverSsh: true.
  • The phone allowlist adds managedServer.status and managedServer.update as paired-desktop routes. The desktop answers them, gated on a new managedServer.mobile.v1 capability.
  • managedServer.status takes skipTerminalCensus, so the phone's version read opens no connection to the server.
  • managedServer.update takes pastLiveTerminals (already in the desktop's IPC).
  • orcadUpdateAnywayConfirmation moved to shared code. The desktop renderer and the phone now word the confirm from the same deferral.

Store behaviour:

  • Each server is read once per visit. A read is retried only if it didn't answer, and never sent twice at once.
  • Managed servers are read only while the computer's SSH to them is up, so a visit never makes the desktop dial.
  • Rows wake only for their own server.
  • Servers the computer stops listing are forgotten. Removing a computer ends anything still running for its servers.

Why

Before this, the phone could update the computer's Orca (#51708) but had no path for its servers. The notice inside a server workspace named the server with no action. updater.* already routes to execution hosts, so a self-updating server needed only a scoped client and a row.

An SSH-managed server can't update itself: only the desktop that deployed it holds the template and the SSH access. So the phone asks that desktop to do it, the same call its Settings makes, rather than reaching for the server. The confirm reuses the desktop's deferral rule, so the phone and the desktop can't disagree about when "Update anyway" is safe.

Linked Issue

No GitHub issue. This is the server follow-up to #51708.

Visual Proof

Real run on a simulator. The setup:

  • A hidden dev desktop from this branch, which the phone paired to.
  • Studio Mac: a packaged Orca 1.4.214-local.1000 paired to the desktop as a server, with 1.4.214-local.2000 offered.
  • Build Box: an orcad the desktop deployed over SSH to a loopback sshd, with one terminal running and a newer template on the desktop.

There's no before capture of these rows because they didn't exist. Before, Edit computer listed only the computer's own Orca and agent CLIs.

Both kinds of server:

(screenshot removed: contained real product data)

SSH-managed (Build Box): Update → the desktop defers over the running terminal → Update anyway → updated. The terminal is still running afterwards (liveSessions: 1).

(screenshot removed: contained real product data) (screenshot removed: contained real product data) (screenshot removed: contained real product data)

Self-updating (Studio Mac): Download → Restart. ShipIt swapped the app to 1.4.214-local.2000, and the row and toast confirm it.

(screenshot removed: contained real product data) (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 flows: the run above, on an iOS simulator against a hidden dev desktop.

    • Build Box went from 0.1.0+9a48a8806158 to 0.1.0+2208243ce97f through the deferral and Update anyway.
    • Studio Mac went from 1.4.214-local.1000 to 1.4.214-local.2000 and reconnected.
  • pnpm check:changed passes (typecheck, lint, localization, ratchets, focused tests).

  • No new test: the new logic is phone store wiring and an RPC route. Both flows were proven end to end above, and a unit test here would test mocks.

Performance

None that grows. Opening Edit computer sends one status read per listed server, and only to servers that can answer: relayed servers whose relay is ready, and SSH-managed ones whose SSH is up. Each read is retried only if it failed. The server list feed is subscribed only while Edit computer is in front. With nothing changing, nothing is published. A write wakes only that server's row plus one due-set check over the listed servers. The managed status read skips the terminal census, so the server gets no extra connection.

Risk

Level: Medium

  • Riskiest part: "Update anyway" from the phone on an SSH-managed server. It passes the same pastLiveTerminals the desktop's Settings passes, so the desktop still refuses if the server changed (incumbent version check) or if an uncounted daemon is live.
  • Mixed versions:
    • An older desktop lacks managedServer.mobile.v1 or the relay list event, so the phone shows no server rows and the notice keeps no action.
    • An older phone ignores managedOverSsh (an optional field).
    • The new RPC params are optional, so older desktops reject nothing new.
  • Phone release: native screens, shipped with the next app release.
  • 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

  • Security: phones reach only managedServer.status and managedServer.update. These are the same host-admin level as the updater.* methods phones already call, and are gated by the phone allowlist.
  • Cross-platform: no platform-specific code.
  • SSH: covered by the real run above.
  • Folder workspaces: unaffected.

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)

@greptile-apps

greptile-apps Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge, with two previously reported, non-blocking issues still open.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with two previously reported, non-blocking issues still open.

Findings

  1. P2 Failed reads never retry ▶
  2. P2 Update links lead nowhere ▶

Summary

This PR adds server updates to Edit computer on the phone.

  • Self-updating servers get their own Orca update rows and sheet.
  • The phone can ask the desktop to update servers it manages over SSH.
  • Server update notices can open Edit computer when an update is available there.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Phone[Phone: Edit computer] --> Kind{Server kind}
  Kind -->|Self-updating| Scoped[Client scoped to server]
  Scoped --> Desktop[Paired computer relays updater calls]
  Desktop --> Server[Server downloads and restarts]
  Kind -->|SSH-managed| Managed[Computer runs managedServer.update]
  Managed --> Check{Running terminals?}
  Check -->|Yes| Confirm[Phone asks Update anyway]
  Confirm --> Checked[Retry with pastLiveTerminals]
  Checked --> SSH[Computer updates server over SSH]
  Check -->|No| SSH
Loading

Reviews (4) · Last reviewed commit: "fix(mobile): report a server update as d..." · Reviewed by Greptile

Comment on lines +100 to +105
void read.then((ok) => {
current.pending.delete(key)
if (ok) {
current.answered.add(key)
}
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Failed reads never retry

When a status request times out while the computer stays connected, this callback removes the key from pending but changes no state. Unchanged host-list replies keep the same array, so the effect does not run again. The server's update row stays missing until the user leaves and returns or another host fact changes. Schedule a bounded retry for reads that return false.

Comment on lines +68 to +71
return {
name: server.name ?? computerName,
action: updatesServers
? { label: t('host.updateNotice.howToUpdate', 'How to update'), onPress: openServers }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Update links lead nowhere

An already-open workspace uses useRelayHosts(..., 'all'), including servers later paired directly to the phone. Edit computer uses 'listed', which removes those servers, but this notice still offers How to update for them. Users can follow the link and find no row for their server. Check that the target will be listed, or open the direct pairing that owns its update row.

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Files ignored due to path filters: 1

  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
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: 590629ff-7d35-471c-a55d-3fdf32039567
Commits

Reviewing files that changed from the base of the PR and between 7767bff and f4a58de.

Files ignored due to path filters: 1

  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The change adds mobile status reads and update requests for eligible servers, including servers managed over SSH. It extends managed-server RPC routing and adds terminal-census options and terminal-related update confirmation. Host update screens display managed and relayed server updates alongside Orca and CLI updates. Orca update state now supports keyed subscriptions and runtime-server-scoped connections.

Merge Risk: Low · previous review 7767b · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(mobile): update the servers a computer reaches from Edit computer" matches the main change. The PR adds update rows for servers reached through a paired computer in the mobile Edit com…
Description check Passed The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill upstream boundary, Note…
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.
Full details: Title check

Explanation

The title "feat(mobile): update the servers a computer reaches from Edit computer" matches the main change. The PR adds update rows for servers reached through a paired computer in the mobile Edit computer screen, including self-updating servers and SSH-managed servers. The title is specific and concise, and it follows a conventional commit style.

Full details: Description check

Explanation

The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections. It gives detailed before and after behaviour, a performance rationale, and a risk level with a backout plan. The Linked Issue section names no issue, only a follow-up to #51708. The Testing section leaves the automated-test checkbox unchecked and explains why no test was added. The AI Disclosure section is empty, but the template marks it as optional for internal contributors. Those gaps are minor and do not make the description incomplete.

  • 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

Recent 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: 7acdccbc-f404-4115-87c3-09d855e12ca2
Commits

Reviewing files that changed from the base of the PR and between 2c50c98 and 7767bff.

Files selected for processing: 2

  • mobile/src/host-screen/identity/updates/HostServerUpdateRows.tsx
  • mobile/src/host-screen/identity/updates/host-managed-server-update.ts

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

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

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: 31f9cbbe-d398-45e3-8db4-326eb2d171a0
Commits

Reviewing files that changed from the base of the PR and between f1a005a and 2c50c98.

Files ignored due to path filters: 1

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

  • mobile/app/h/[hostId]/index.tsx
  • mobile/src/host-catalog/host-removal-lifecycle.ts
  • mobile/src/host-screen/identity/updates/HostServerUpdateRows.tsx
  • mobile/src/host-screen/identity/updates/HostUpdatesSection.tsx
  • mobile/src/host-screen/identity/updates/host-managed-server-operations.ts
  • mobile/src/host-screen/identity/updates/host-managed-server-update.ts
  • mobile/src/host-screen/identity/updates/host-orca-update-snapshot.ts
  • mobile/src/host-screen/identity/updates/host-orca-update-transport.ts
  • mobile/src/host-screen/identity/updates/host-orca-update.ts
  • mobile/src/host-screen/identity/updates/keyed-update-listeners.ts
  • mobile/src/host-screen/identity/updates/use-host-orca-update.ts
  • mobile/src/host-update-notice/HostUpdateNotice.tsx
  • mobile/src/i18n/locales/en.json
  • mobile/src/worktree/execution-hosts/server-workspace-operations.ts
  • mobile/src/worktree/execution-hosts/workspace-server-context.ts
  • mobile/src/worktree/execution-hosts/workspace-server.ts
  • src/main/ipc/runtime-environments/lazy-runtime-environment-handlers.ts
  • src/main/ipc/runtime-environments/managed-orcad/managed-orcad-actions.ts
  • src/main/managed-server/lifecycle/orcad-runtime-status.ts
  • src/main/runtime/hosts/management/managed-server-actions-registry.ts
  • src/main/runtime/hosts/runtime-status.ts
  • src/main/runtime/mobile-desktop-relay/mobile-relay-host-catalog.ts
  • src/main/runtime/mobile-desktop-relay/mobile-relay-host-descriptions.ts
  • src/main/runtime/rpc/methods/host-management/managed-server.ts
  • src/main/runtime/rpc/server/runtime-rpc-mobile-host-update-methods.ts
  • src/main/runtime/rpc/server/runtime-rpc-mobile-paired-desktop-methods.ts
  • src/renderer/src/components/settings/runtime-environments/managed-servers/use-managed-server-lifecycle.ts
  • src/shared/remote-runtime/orcad-lifecycle/orcad-managed-runtime.ts
  • src/shared/remote-runtime/protocol/host-runtime-capabilities.ts
  • src/shared/remote-runtime/relay/mobile-relay-hosts-contract.ts
  • src/shared/rpc-contract/host-management/managed-server-params.ts

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

)
)
if (outcome.outcome !== 'deferred') {
write(key, owner, (update) => ({ ...update, run: { phase: 'updated' } }))

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 installed build from the successful reply.

When a server moves from build A to build B of the same Orca release, the desktop returns activeVersion: B. This write discards B and renders “Updated to A” from the old status. If the follow-up status read times out, the row continues to show A. Publish the confirmed build with the success state. Use the follow-up read to refresh status and discover any newer offer.

return
}
// The server may have moved on (or been moved on by another desktop): read what it runs now.
await readStatus(desktopClient, key, environmentId, owner)

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 · Data Integrity & Integration · Quick win

Gate the post-update status read on the desktop's SSH connection.

After an update attempt, readStatus runs with skipTerminalCensus: true and no connection check. If the desktop's SSH link drops during the update while the phone stays connected to the desktop, this read reaches managedServer.status. The desktop then calls connectionManager.connect(target) before it reaches the census branch, so the read can reconnect SSH. The skip flag does not prevent this. The PR states that status reads occur only while SSH is up, so this read breaks that stated behavior.

Apply the same connection gate that protects the initial status read before the follow-up read at line 160. If the gate reports SSH down, skip the follow-up read and leave the run state unchanged. Do not treat the missing reply as an update result.

Comment on lines +120 to +123
for (const key of visit.current.answered) {
settleManagedServerUpdate(key)
}
visit.current = newVisit()

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

Settle managed results that finish after the visit ends.

If the user leaves while a managed update is running, blur attempts to settle it, but the store keeps updating. If it finishes before the user returns, the next visit still shows “Updated to” even when there is no offer. Only the next blur clears that result. Settle results from earlier visits when the screen opens, without clearing a run that is still in progress.

Comment on lines +63 to +67
const updatesServers = server.managedOverSsh
? desktopCapabilities.includes(MANAGED_SERVER_MOBILE_RUNTIME_CAPABILITY)
: desktopCapabilities.includes(REMOTE_SERVER_UPDATE_MOBILE_CAPABILITY) &&
gates !== null &&
canUpdateOrcaFromPhone(gates.hostCapabilities, gates.hostUpdateSupport)

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 · Heavy lift

Gate the notice link on a server update row, not just update support.

A desktop can advertise managedServer.mobile.v1 while its bundled build is already installed on the server. The notice then offers “How to update,” but Edit computer receives no update offer and shows no row for that server. The self-updating branch also checks support without checking for an offer.

Use the same eligibility criteria as Edit computer, including list membership and a due update. If the notice cannot establish that a row is available, keep the existing recheck or non-link state.

Edit computer's Updates group now lists the servers the computer reaches
that have an Orca update. A server that updates itself opens the same
update sheet, through the computer's connection to it. A server the
computer runs over SSH is updated by the computer (managedServer.update),
with the desktop's Update anyway confirm over running terminals. A
server workspace's update notice opens Edit computer.

Hosts list each SSH-managed server as managedOverSsh, let phones call
managedServer.status/update on the paired-desktop route (advertised as
managedServer.mobile.v1), and take pastLiveTerminals so a phone's Update
anyway keeps Update's version checks, as the desktop's does.
Removing a computer ends its server updates, rows wake only for their own
server, and the notice links to Edit computer only for servers listed there.
A refused or held update also leaves no offer, so a lost reply counts as updated only when the
server runs another build. Pending reads span visits, finished relayed results settle on blur,
a failure the server moved past gives way to the newer offer, and Update anyway waits for a
connection.
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