Skip to content

fix(agent-cli-update): clear settled failures and name the CLI Orca reads - #52743

Merged
nwparker merged 1 commit into
stablyai:mainfrom
lurunzi:fix/agent-cli-update-stale-failure
Nov 30, 2026
Merged

nwparker merged 1 commit into
stablyai:mainfrom
lurunzi:fix/agent-cli-update-stale-failure

Conversation

@lurunzi

@lurunzi lurunzi commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

When a CLI update failed, Orca kept showing "update failed" even after the user fixed the CLI. The error also never said which copy of the CLI Orca was checking. Now the old error goes away once the computer reports that the CLI is up to date. A failed update also names the program Orca checked, its version, and the latest release.

What Changed

  • Before: a failed run kept its "update failed" row with Try again, both in the desktop status-bar list and on mobile's Edit computer. The row stayed until a new run replaced it, even after agentCliUpdate.check stopped offering that agent.
  • After: agentCliUpdate.check also returns current: the enabled agents whose own CLI the host read at its latest release. The host already reads both versions during the check, so nothing extra runs. When a check lists an agent in current, desktop (agent-cli-updates slice) and mobile (host-agent-cli-updates) drop that agent's failed run if it finished before the check was sent. The shared helper for this is agentCliUpdateRunsAfterCheck. When nothing changes it returns the same object, so the store isn't rewritten.
  • A failed update's output now ends with one line naming the program Orca reads (plus its real path when that differs), its version and the latest release. Example: Orca reads Claude Code 1.0.0 from /npm/bin/claude; the latest release is 2.0.0. The line uses the host's UI language, like its notifications. A headless host sends English. All locales have the line.

Why

In #52735, an agent environment setting put an old npm copy of Codex first on PATH. codex update kept updating the user's real install while Orca kept reading the shadowed copy. The failure output showed only the installer's success message. After the user fixed the setting, the stale failure row still stayed.

The simpler option was to drop any failed row that a later check no longer lists. We rejected it: a CLI whose version can't be read after a failed update is also unlisted, and that real failure would disappear. The explicit current list clears only CLIs the host actually read at their latest release. Runs that failed after the check was sent are kept.

Linked Issue

Fixes #52735

Original fix by @lurunzi in #52743.

Visual Proof

No screenshots or recordings were captured. Two things change on screen: a failed row disappears after a re-check, and the failure dialog's output text gains one line. No layout or component changed. Unit tests cover both changes, and they fail on main: the settled row stays and the line is missing. Details are under Testing.

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

  • New host test agent-cli-update-run.test.ts: an update that lands in a copy shadowed by the CLI Orca reads fails, and the output names /npm/bin/claude with its version and the latest release. After the PATH is fixed, the check returns { updates: [], current: ['claude'] }.

  • New renderer test agent-cli-updates.test.ts: a failed run is dropped once a later check reports the agent in current.

  • Probes on main and on this branch also covered these cases:

    • a host too old to send current keeps the failed row, and the store isn't rewritten
    • current naming a different agent keeps the failure
    • a failure recorded after the check was sent survives the check
    • a malformed or mixed current on mobile is filtered
    • an unreadable version counts as neither an update nor current
    • a disabled agent is excluded
    • the failure line has both forms: the program with its real path, and the "could not read the version" message
  • These tests pass with config/vitest.config.ts and mobile's vitest config: src/main/agent-cli-update, src/renderer/src/store/slices/runtime-host-updates, src/shared/agent-launch/installation and mobile/src/host-screen/identity/updates. The contributor also tested on Windows: with the shadowing PATH, the check reported the shadowed copy, and after the setting was fixed it returned no update.

  • The CI static gates pass on the touched files: anti-slop oxlint, code-quality native plugins, ast-grep, changed-code quality, and oxfmt.

Performance

None. This runs only on update checks and update runs, not on startup, typing, terminal output or rendering. The host reports versions it already reads, with no new subprocess or I/O. The version note is built only when an update fails. Clients filter one small per-host record per check:

  • typical (no runs, 18 current): 108 ns
  • one failure settled: 204 ns
  • worst case (all 18 failed and current): 469 ns
  • older host without current: 10 ns

This is per host, not per tab or pane. An unchanged answer still leaves the store alone.

Risk

The riskiest part is clients dropping failed rows. A host that wrongly reads a CLI as current would hide a real failure, but that same misread already hides the update offer today. Older hosts don't send current, so new clients keep today's behavior with them. Older clients ignore the extra field. Saved data and settings are untouched. A plain revert backs it out.

Level: Low

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

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; no actionable issues were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

The PR clears old CLI update failures after the host reports that the CLI is current.

  • A current CLI check clears older failed update rows.
  • Failed updates name the CLI Orca reads.

No actionable issues were found. The review checked source code; it did not run tests or capture the UI.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Host checks enabled CLIs] --> B{Version result}
  B -->|Behind| C[Offer update]
  B -->|Unread or missing| D[Keep failed row]
  B -->|Current| E{Failure recorded before check?}
  E -->|Yes| F[Clear failed row]
  E -->|No| G[Keep newer or active run]
Loading

Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'refs/remot..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The update check now distinguishes agents at the latest CLI release from agents with available updates. Its result includes current-agent state. Desktop and mobile check flows use that state and the check send time to reconcile failed update runs. Update failures include reread version and CLI location details when available.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 13059

Stale failed agent CLI update rows are cleared once the host reads the CLI at its latest release, and failure output now names the program Orca reads. No actionable merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main fix: failed update rows are cleared once the CLI is current, and failure messages name the CLI Orca reads. The changeset adds the current list, the run-filtering helper, and…
Description check Passed The description follows the template and covers ELI5, What Changed, Why, Linked Issue (Fixes #52735), Testing, Performance, Risk, AI Disclosure, and the upstream boundary checkbox. The Visual Proof se…
Linked Issues check Passed [#52735] Objective 1, stale failed rows: The host check now returns an optional current list of enabled agents whose installed CLI is at its latest release (src/main/agent-cli-update/agent-cli-updat…
Out of Scope Changes check Passed All changed areas map to #52735. They are: the check result type (AgentCliUpdateCheckResult with optional current), the RPC return shape, host version comparison and failure-message detail, deskto…
Full details: Title check

Explanation

The title names the main fix: failed update rows are cleared once the CLI is current, and failure messages name the CLI Orca reads. The changeset adds the current list, the run-filtering helper, and the failure-output path/version note, so the title matches the main change. The title is 73 characters, within a typical length, and is specific.

Full details: Description check

Explanation

The description follows the template and covers ELI5, What Changed, Why, Linked Issue (Fixes #52735), Testing, Performance, Risk, AI Disclosure, and the upstream boundary checkbox. The Visual Proof section explains why no capture was attached. Gaps: the Testing section states no new test was added, yet the template asks that every added test fail without the change, and the PR checklist leaves lint, typecheck, test, and build unchecked. The Risk level is set to Low. The Performance and Risk sections are filled in. The AI Disclosure section is filled in, which is acceptable for a non-team contributor.

Full details: Linked Issues check

Explanation

[#52735] Objective 1, stale failed rows: The host check now returns an optional current list of enabled agents whose installed CLI is at its latest release (src/main/agent-cli-update/agent-cli-update-service.ts, summary). The RPC returns it (src/main/runtime/rpc/methods/host-management/agent-cli-update.ts). The shared helper agentCliUpdateRunsAfterCheck (src/shared/agent-launch/installation/agent-cli-update-runs.ts) removes failed runs for agents in current whose finishedAt is at or before sentAt. Desktop (src/renderer/src/store/slices/runtime-host-updates/agent-cli-updates.ts) and mobile (mobile/src/host-screen/identity/updates/host-agent-cli-updates.ts) both apply this helper. A unit test for the desktop slice covers clearing a failed run after a check lists claude as current. Objective 2, failure output: failed results now include a note naming the CLI location, the read version, or its status relative to the latest release (summary of agent-cli-update-service.ts). A unit test in agent-cli-update-run.test.ts covers the shadowed Claude case, which expects the failure message to name the read path, version, and latest release. Older hosts omit current, and clients keep prior behavior. Evidence is the whole-PR summary, PR description, and test summary. Source lines were not re-read in this pass. The previous PASS conclusion remains supported; the added test strengthens it.

Full details: Out of Scope Changes check

Explanation

All changed areas map to #52735. They are: the check result type (AgentCliUpdateCheckResult with optional current), the RPC return shape, host version comparison and failure-message detail, desktop and mobile run reconciliation using sentAt, the shared helper, and the mobile parser that filters current to recognized agents. The locale files add only strings for the new failure and status messages, which supports the new output text. The tests cover the new behavior. No unrelated feature, layout, or persistence change appears in the summary. The PR states that saved data and settings are untouched.

  • 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: aed873b6-6351-4cfa-9c3e-633ce5a137db
Commits

Reviewing files that changed from the base of the PR and between c0a5894 and 1305944.

Files selected for processing: 17

  • mobile/src/host-screen/identity/updates/host-agent-cli-updates.ts
  • src/main/agent-cli-update/agent-cli-update-run.test.ts
  • src/main/agent-cli-update/agent-cli-update-service.ts
  • src/main/runtime/rpc/methods/host-management/agent-cli-update.ts
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/store/slices/runtime-host-updates/agent-cli-updates.test.ts
  • src/renderer/src/store/slices/runtime-host-updates/agent-cli-updates.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.

…eads

agentCliUpdate.check now also returns `current`, the enabled agents whose
own CLI was read at its latest release. Desktop and mobile drop a failed
run recorded before a check that lists its agent in `current`, so a fixed
CLI no longer keeps a stale "update failed" row. Older hosts omit
`current`, and clients then keep today's rows.

A failed update now ends its output with the program Orca reads (and its
real path when that differs), its version and the latest release, in the
host's UI language, so an update that landed in a copy shadowed by an
earlier PATH entry is visible.

Fixes stablyai#52735

Co-authored-by: Neil <[email protected]>
@nwparker
nwparker force-pushed the fix/agent-cli-update-stale-failure branch from c0a5894 to 1305944 Compare November 30, 2026 01:59
@nwparker
nwparker merged commit e264190 into stablyai:main Nov 30, 2026
58 checks passed
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.

Agent CLI update: 'update failed' row persists after the CLI is current, and the failure hides which copy Orca reads

2 participants