Skip to content

fix(worker): detect native cli installs on windows - #994

Merged
nixuuu merged 1 commit into
devfrom
fix/windows-cli-update-detection
Nov 19, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/windows-cli-update-detection

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 18, 2026

Copy link
Copy Markdown
Member

Problem

Canopy detected newer versions for the native Claude Code and Codex Standalone installations in the Windows 11 report. Both were listed as “Other install”, which hid the update action.

Change

  • Recognize the native Claude Code user install and reuse its built-in installer.
  • Recognize the default Codex Standalone launcher when it resolves to a standalone release. Run the official PowerShell installer for the requested release.
  • Cover both reported layouts and unmanaged Codex binaries with regression tests.

Verification

  • Linux on nix-pc, revision abcdd24b. All 31 tests passed across CLI discovery, CLI locations, and gateway/worker CLI integration. The test temp directory was clean.
  • Worker typecheck, Oxlint on edited TypeScript files, and git diff --check passed.
  • Actual updates on Windows 11 are unverified. No Windows 11 test machine was available. The regression tests simulate Windows installation paths on Linux. This PR remains a draft pending a Windows 11 test that updates both native CLIs from Canopy and confirms the reported versions afterward.

@nixuuu
nixuuu marked this pull request as ready for review November 19, 2026 11:46
@nixuuu

nixuuu commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

Local Linux verification on nix-pc passed for the combined tree 2a269f58838c9c10ead885113ef9164cad4b9e56.

  • PR head abcdd24b3e82d6d1e4a0cf3296adfc232aa6f880
  • Tested dev base 16a986f467a919e0a9624ce91af896ac998eb39f
  • check:tmp passed all 61 tests across CLI discovery, Windows launcher locations, provider CLI integration, Update Center, CLI attempts, and Update all across linked computers. The tests exercised the Canopy-before-CLI ordering from feat(updates): update canopy on online computers before agent clis #1005 and left no test temp files.

The maintainer moved the practical Windows 11 update test to the first published Nightly containing this fix. The Linux regression tests and GitHub checks do not verify a real update of Claude Code or Codex Standalone on Windows 11.

@nixuuu

nixuuu commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

Reverified on Linux (nix-pc) after dev advanced. PR head abcdd24, dev base 9aa8233, combined tree dfcd5b4dae083cf2e1c0472f544adbdd03db1c97. The same six suites passed all 61 tests and check:tmp found no leftovers. The practical Windows 11 update test remains scheduled for Nightly.

@nixuuu
nixuuu merged commit c7b9fcc into dev Nov 19, 2026
16 checks passed
@nixuuu
nixuuu deleted the fix/windows-cli-update-detection branch November 19, 2026 11:50
nixuuu added a commit that referenced this pull request Nov 19, 2026
## Problem

Updating Codex Standalone from Canopy Desktop on Windows starts the
official `install.ps1` in Windows PowerShell. The script rejects Windows
when `$env:OS` is absent. The Desktop service allowlist dropped `OS`
before the worker and installer could inherit it.

## Change

Preserve the OS value inherited by Desktop across the controller and
worker launches. The official script still validates the platform.

Fixes: #994

## Verification

- On `nix-pc` (Linux) at `df3cbe78`, 32 tests passed and one
Windows-only supervisor test was skipped. The affected process recovery,
CLI discovery, and gateway-to-worker CLI integration tests ran through
`check:tmp` with no leftovers.
- Added a subprocess regression that failed on the original allowlist.
On Linux it supplies a synthetic Windows environment value and checks
what the installer process receives. On Windows it runs the same guard
in `powershell.exe`. A live Codex upgrade on Windows remains unverified.
- Desktop typecheck, lint on edited files, commitlint, and `git diff
--check` passed. The full verification gate runs in GitHub Actions.
nixuuu added a commit that referenced this pull request Nov 19, 2026
## Problem

Canopy could refuse a Claude Code update based on a saved running
report, even if the worker had reconnected and had no such installation.
During an actual overlap, a second click could also surface a start
refusal as a failed update. The reported Nightly installer output
confirms Claude Code 2.1.328 was ready on Windows. The screenshot and
output do not share an attempt ID. The Windows detection change in #994
enabled the action for native installs.

## Change

- Use the current worker connection for live installer status, and keep
installer output with its attempt ID.
- Let the worker arbitrate installs. Repeated individual requests for
the same active target use the existing result. Update all reconciles an
explicit busy refusal with later reports and follows the active attempt
ID. An install gets its full completion window once the contention
clears.
- Wait for any active installer for that CLI to finish validation before
treating its reported version as proof of success. The worker checks the
installed version again before installing an Update all target,
including when a linked snapshot is stale. The coordinator sends guarded
installs only on a live link to a gateway that supports the guard.
- Record the accepted attempt ID in the audit entry.

## Verification

- Revision `06bb2f70` on Linux (`nix-pc`). All 86 tests passed across
provider-cli, update-cli-attempts, mise-cli, update-center,
update-all-computers, and cli-discovery. The test temp directory was
clean.
- Regression coverage includes an outdated running report, repeated
requests, same-version correlation, different-version contention, a
rollback-capable competing attempt a guarded stale target sent to the
worker, and an older linked gateway that must receive only the ordinary
unguarded request.
- Generated contracts with `bun run gen`. Gateway, worker, and
integration test typechecks passed. Targeted Oxlint, Oxfmt and `git diff
--check` passed.
- Tests exercise a real Linux worker and simulated installers. Windows
execution of this revision remains unverified.

## Copy audit

- Update all now tells the user to update an older worker before
retrying a guarded install. If the worker cannot identify the installed
CLI version, the message explains the missing version and gives the next
action. An older linked gateway gets a short Canopy update instruction
in the same place.
- Checked both messages in the existing Updates popover against a local
fixture in a desktop-width light view and a 390 px dark view with short
and long worker names. The existing error control provides the full text
when the compact row truncates it.

Fixes: #26
Fixes: #947
Related: #994
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