You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(mobile): update a computer's agent CLIs from Edit computer - #51707
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)
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.
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: 4
Check name
Status
Explanation
Title check
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
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
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.
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
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.
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.
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
What Changed
installed → latest, plus "adds " when the host says the release brings a model;agentCliUpdate.checkandagentCliUpdate.run(execution-host routes, in a new per-feature allowlist file), advertised asagent-cli-update.mobile.v1;src/shared, and desktop now reads them from there.Why
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.agentCliUpdate.subscribeon 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.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.
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 upgradeon 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.v1the 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:nodepass.Test:
agent-cli-updater-output.test.tspins 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 onmaintoo (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.checkon 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
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)