Skip to content

feat(mobile): update a computer's agent CLIs from Edit computer - #51707

Merged
AmoabaKelvin merged 4 commits into
mainfrom
mobile-agent-cli-updates
Nov 28, 2026
Merged

AmoabaKelvin merged 4 commits into
mainfrom
mobile-agent-cli-updates

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

Your phone can now update the coding agents installed on your computer (Claude Code, Codex, OpenCode and the rest). Open the computer's Edit screen and each one with a newer release has an Update button.

Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​19 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​19
Prod 25 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1142 $\color{#cf222e}{\Huge{\mathbf{−}}}$​171 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​971

What Changed

  • Before: Edit computer showed only "Orca version". The computer could already check and update its agent CLIs (the desktop has a card and a toast for it), but a phone was never allowed to ask.
  • After: when a computer has CLI updates, "Orca version" becomes an Updates group:
    • one row per CLI with a newer release: installed → latest, plus "adds " when the host says the release brings a model;
    • Update runs it on the computer, Update all in the header runs every runnable one (three at a time, the rest show Queued);
    • Updating…, then Updated to X with a tick, or a red Update failed with Try again; tapping a failed row opens what ran and what it printed;
    • a CLI Orca can't update itself shows its command, wrapped, with a copy button;
    • with nothing to update, the screen looks exactly as before.
  • Host:
    • phones may call agentCliUpdate.check and agentCliUpdate.run (execution-host routes, in a new per-feature allowlist file), advertised as agent-cli-update.mobile.v1;
    • installs are capped at three per computer on the host itself, not only per client, so a desktop and a phone together can't start six;
    • updater output is stored as plain text: escape codes stripped, and a spinner that redraws itself keeps only its last frame. Desktop's failure dialog gets the same clean text.
  • Shared: the run rules (12-minute client ceiling, three at a time, how an answer becomes a row) and the CLI product names move from the desktop store to src/shared, and desktop now reads them from there.

Why

  • The host already owned CLI updates; the phone only lacked permission and a screen, so this reuses the host's check and run rather than adding anything new on the computer.
  • A new capability instead of agent-cli-update.v1: that one is advertised by hosts that refuse phones these calls, and a server a phone reaches through a desktop enforces its own allowlist.
  • No agentCliUpdate.subscribe on the phone: a phone has no way to end that stream on the host, so every visit would leave a listener behind until the socket closes. The phone checks when the screen opens (an answer is reused for 10 s) and after its own runs.
  • A dropped connection is "unknown", not "failed" or "updated": the host joins a run already going, so the phone asks again once reconnected. If the computer no longer offers that update, the row just goes, without claiming success.
  • Host-side install bound: the client limit was per window or phone, so the computer's own budget was the only place that could hold for every client.

Linked Issue

No GitHub issue; part of the phone parity work (update the computer's Orca and its agent CLIs from the phone). First of three stacked PRs.

Visual Proof

Before (Edit computer today) and after, on an iOS 27 simulator paired to a hidden worktree serve with a scratch HOME and an old OpenCode (1.19.4) in a scratch npm prefix. Copilot is the Mac's own install and was not touched.

Before Updates (dark) Updates (light) Updating
(screenshot removed: contained real product data) (screenshot removed: contained real product data) (screenshot removed: contained real product data) (screenshot removed: contained real product data)
Updated Updated (light) Failed What it printed
(screenshot removed: contained real product data) (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

  • iOS simulator + worktree serve (macOS): Update on OpenCode ran opencode upgrade on the host; the binary went 1.19.4 → 1.19.6 and the row showed "Updated to 1.19.6". With the install folder read-only, the same tap failed for real (exit code 243); the row kept "Update failed" across a host restart, and the sheet showed the command and its output.

  • Old hosts: without agent-cli-update.mobile.v1 the section is today's single "Orca version" row.

  • Desktop: the status-bar list, card and toast run on the shared rules unchanged; pnpm tc:web / tc:node pass.

  • Test: agent-cli-updater-output.test.ts pins the output cleanup (spinner frames, carriage returns, short cursor moves keep their text). It fails without the change.

  • Not run: Windows and Linux hosts (no path or process code changed; the run itself is the host's existing updater), and Android.

  • agent-cli-update-timeout.test.ts "settles soon after the updater exits…" fails on this Mac on main too (same result with main's service file); CI is the gate for it.

Performance

None that grows with the fleet, because the phone does work only while Edit computer is in front: one agentCliUpdate.check on open (reused for 10 s, skipped while the screen is covered), and one run per tap. Nothing polls. An unchanged answer writes nothing. Per-computer state is dropped when the computer is removed, and a late answer for a removed computer lands nowhere. Output cleanup runs once per finished run over at most 128 KiB.

Risk

Level: Medium

  • Riskiest part: the host-side cap of three installs. A desktop and a phone updating at once now queue on the host; a queued run still settles through the client's late-answer path.

  • Mixed versions: both new pieces are additive. An older phone never calls these methods; a newer phone on an older host sees the old screen.

  • Back out: a plain revert. Nothing is persisted.

  • Phone release: Edit computer is a native screen, so phones get this with the next app release. No native modules change.

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

  • Phone methods are allowlisted on the execution-host route, so a server workspace's CLIs would route to that server; Edit computer only asks the paired computer today.

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)

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review
Walkthrough

The PR adds mobile support for checking and running agent CLI updates on hosts with the required capability. It adds update RPC methods, shared update state and helpers, and a mobile interface for update status, retries, command copying, and completion details. Desktop update code also adopts shared helpers and product names. The host update service limits concurrent installations and normalizes updater output.

Merge Risk: Low · up to c1ba1

The mobile update flow works, but the update list can stay stale after a quick reconnect or after another client updates a CLI. A lost-answer recovery check can also be skipped after an endpoint change. Each case clears on the next check, so the risk is low; they are worth fixing before or soon after merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(mobile): update a computer's agent CLIs from Edit computer" matches the main change: the mobile Edit computer screen now lists and runs agent CLI updates on the paired computer. It is …
Description check Passed The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue, Visual Proof with before and after images, Testing, Performance, Risk with a level, Notes, and a …
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 a computer's agent CLIs from Edit computer" matches the main change: the mobile Edit computer screen now lists and runs agent CLI updates on the paired computer. It is specific, concise, and follows a conventional commit style. The changeset also includes host-side allowlisting, a concurrency cap, and shared update-run rules, which the title does not mention, but it does not need to cover every detail.

Full details: Description check

Explanation

The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue, Visual Proof with before and after images, Testing, Performance, Risk with a level, Notes, and a checklist. The Linked Issue section states there is no GitHub issue, which the template says outside contributors must provide, but the author is a maintainer-style contributor on a stacked PR, so this is a minor gap. The Risk level is set to Medium. The Performance section gives a concrete reason. The final lint/typecheck/test/build checkbox is unchecked, and the AI Disclosure section is empty, which is acceptable for internal contributors. The description is mostly complete with only minor gaps.

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

Minor comments: 1

mobile/src/host-screen/identity/updates/HostUpdatesSection.tsx: 1

65-65: Minor · Functional Correctness · Low value

A reconnect within ten seconds of a check does not refresh the update list.

The focus effect in HostUpdatesSection.tsx re-runs when client or online changes. Its unforced checkHostAgentCliUpdates call returns early when the last check started less than CHECK_REUSE_MS (10 seconds) earlier, so no request is sent. No other path in mobile/src calls the check after a reconnect, and nothing schedules a later check. If the host changed a CLI during the drop, the list keeps the pre-drop row until the user leaves and returns. The PR states that the phone checks again after reconnecting, so the reuse guard does not meet that intent for reconnects inside the window.

The fix must make the post-reconnect check run regardless of the reuse window. Keep the ordinary focus reuse behavior. Forcing every focus-effect run would also skip the guard on normal re-focus, so the fix must distinguish a reconnect from a fresh open.

Additional comments: 1

mobile/src/host-screen/identity/updates/host-agent-cli-updates.ts-200-200: 1

200-200: Minor · Functional Correctness · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Check again after answered runs.

When a run returns success or a confirmed failure, this branch skips the check. The focused screen does not trigger another check because its connection dependencies have not changed. This omits the post-run refresh required by the PR objectives.

Schedule a forced check after each completed run, including late completion. Keep the successful row in done for the current visit.

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: 9e5458ce-0f6f-4b46-9ba2-8cf6d85ea913
Commits

Reviewing files that changed from the base of the PR and between 95f6bb9 and 988e3f7.

Files selected for processing: 25

  • mobile/app/h/[hostId]/edit.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/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/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/renderer/src/components/agent-cli-update/AgentCliUpdateCard.tsx
  • src/renderer/src/components/agent-cli-update/agent-cli-product-name.ts
  • 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/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; 6 remain after this review.

@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-agent-cli-updates branch from 988e3f7 to 5c93e1a Compare November 28, 2026 10:44

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

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: 3071e5a3-889e-4270-9169-2ecaa45dbd35
Commits

Reviewing files that changed from the base of the PR and between 5c93e1a and baa1042.

Files selected for processing: 3

  • mobile/src/host-screen/identity/updates/host-agent-cli-updates.ts
  • src/renderer/src/store/slices/runtime-host-updates/agent-cli-updates.ts
  • src/shared/agent-launch/installation/agent-cli-update-runs.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.

The phone could see a computer's Orca version but had no way to update the
agent CLIs installed there. Hosts now let phones call agentCliUpdate.check
and agentCliUpdate.run (advertised as agent-cli-update.mobile.v1), and Edit
computer lists each CLI with a newer release: Update, Queued, Updating,
Updated, a failure sheet with what ran and what it printed, and the
command to copy when Orca can't run it. The run rules (timeouts, three at a
time, result mapping) and product names move to src/shared so desktop and
phone follow the same ones.
…n row

A connection that dropped after the client's ceiling now leaves the row
unknown and re-checks after reconnecting, as a drop before the ceiling
already did, instead of reporting the transport error as a failed update.
A recovery check now removes only the row of the run that lost its reply,
never a failure a retry got from the host since.
A recheck after a lost answer now waits for a check already in flight and
asks again, and each check settles only the lost runs recorded before it
was sent. A check sent before an update landed no longer offers that CLI
again, and a run the client ceiling cut short starts the same recovery.
@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-agent-cli-updates branch from baa1042 to 666249f 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: 32344892-e057-4a32-9dd1-13ae26f9b1ff
Commits

Reviewing files that changed from the base of the PR and between baa1042 and 666249f.

Files selected for processing: 3

  • mobile/src/host-catalog/host-removal-lifecycle.ts
  • mobile/src/host-screen/identity/updates/host-agent-cli-updates.ts
  • 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; 8 remain after this review.

.request(client, { agent }, { timeoutMs: AGENT_CLI_UPDATE_RUN_TIMEOUT_MS })
.then((reply) => agentCliUpdateRun.interpret(reply))
).finally(release)
const settled = settleRun(hostId, entry, agent, result)

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

Refresh the update list after an answered run.

The phone must check for updates after its own runs. runHostAgentCliUpdate does not do this. After a run gets an answer, the success path removes only that agent's row, and the failure path stores only that agent's failure. Other update rows keep the snapshot from before the run. A CLI that the desktop updated in the meantime stays offered until the screen is focused again. Add a check on the answered path so the list reflects the host's current state.

Suggested fix

   } else if (!answered && settled) {
     markUnanswered(hostId, entry, client, agent, settled)
+  }
+  if (answered) {
+    void checkHostAgentCliUpdates(hostId, client)
   }

…CLI answers

Forced checks waiting behind one in flight now share a single follow-up
check, which reads every loss recorded before it is sent.

@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: 7dceb4ab-933b-4a2c-b460-15e948117055
Commits

Reviewing files that changed from the base of the PR and between 666249f and c1ba170.

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; 4 remain after this review.

}
// A forced check must be asked after whatever made it necessary, not answered by an older one;
// it reads every loss recorded before it is sent, so callers queued meanwhile share it.
entry.forced ??= entry.check.then(() => {

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

Dispatch the shared forced check with the newest client, not the first caller's client.

The Edit computer route passes hostConnection.client to the update section. An endpoint change calls refreshHostClient, which closes the old logical client and binds a new one. A forced check that was queued behind a pending check keeps the first caller's client. If that client is closed before the queued check dispatches, its request fails with Client closed. Every caller that joined the queue then resolves with no check through the current client. Their unanswered runs stay unresolved until a later check runs.

Each forced caller should record its client on the host entry. The queued follow-up should dispatch with the most recently recorded client. This keeps one queued follow-up per host and changes only the client it uses. Physical reconnects need no change, because the stable logical client already keeps the same object across them.

@AmoabaKelvin
AmoabaKelvin merged commit c784ff4 into main Nov 28, 2026
58 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