Repository navigation
fix(agent-cli-update): clear settled failures and name the CLI Orca reads - #52743
Conversation
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryThe PR clears old CLI update failures after the host reports that the CLI is current.
No actionable issues were found. The review checked source code; it did not run tests or capture the UI.
|
|
No actionable comments were generated in the recent review. Walkthrough
Severity of issue fixed: Medium Merge Risk:
|
…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]>
c0a5894 to
1305944
Compare
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
agentCliUpdate.checkstopped offering that agent.agentCliUpdate.checkalso returnscurrent: 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 incurrent, desktop (agent-cli-updatesslice) 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 isagentCliUpdateRunsAfterCheck. When nothing changes it returns the same object, so the store isn't rewritten.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 updatekept 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
currentlist 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/claudewith 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 incurrent.Probes on
mainand on this branch also covered these cases:currentkeeps the failed row, and the store isn't rewrittencurrentnaming a different agent keeps the failurecurrenton mobile is filteredThese tests pass with
config/vitest.config.tsand mobile's vitest config:src/main/agent-cli-update,src/renderer/src/store/slices/runtime-host-updates,src/shared/agent-launch/installationandmobile/src/host-screen/identity/updates. The contributor also tested on Windows: with the shadowingPATH, 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:
current: 10 nsThis 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
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)