Skip to content

feat(updates): support mise and reliable bulk cli updates - #947

Merged
nixuuu merged 2 commits into
devfrom
feat/automate-mise-updates
Nov 18, 2026
Merged

nixuuu merged 2 commits into
devfrom
feat/automate-mise-updates

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Change

Canopy now updates supported global mise installations of Claude Code, Codex and Grok from individual CLI controls and Update all. The recipe activates exact targets with mise use --global --yes --pin, retains installed versions and reactivates the previous version after failed validation. Native and npm mise tool identities and custom MISE_DATA_DIR roots are supported. Project overrides, multiple configured versions, fixed installation paths and mise's latest symlink keep manual instructions. Rollback restores an exact pin even when the previous selector floated.

Update all no longer disables every CLI control in the popover. Independent targets remain actionable while their own queued/running steps, worker updates and computer restarts prevent conflicting actions. The existing four concurrent scheduler slots and per-worker installer resource locks remain in effect, including a shared mise configuration lock through rollback.

CLI steps persist an attempt UUID before dispatch and carry it through the authenticated local or linked InstallCli route. Stale failures cannot fail a new attempt, and uncertain acknowledgements wait for reports instead of failing after 60 seconds. A matching running attempt waits through validation and rollback; confirmed target or newer versions reconcile obsolete failures. Existing manual installations of the same target are followed without another command, and waiting for a different target remains bounded across gateway restarts.

The additive UI install_id field is opaque to computer routing; WorkerLink compatibility and the frozen UpdateService are unchanged. Older linked gateways still confirm success through the installed version, but uncorrelated failures may wait until the step timeout. Full attempt correlation requires updated gateways on both computers. Behavior and release availability are documented separately.

Verification

  • Generated contracts with bun run gen.
  • Focused check:tmp suites passed: mise-cli, cli-discovery, provider-cli, update-cli-attempts, update-center, update-concurrency, and update-all-computers. Coverage includes rollback, shared resources, stale reports, lost acknowledgements, durable restart identity, owner scoping and authenticated linked routing; no temporary files remained.
  • Worker, gateway and integration-test TypeScript checks, web Svelte checks, scoped lint/format checks and diff checks passed locally.
  • Inspected the actual popover components in Chromium at desktop and phone widths in light and dark themes, including long names. Starting one CLI left an independent CLI on another worker actionable; both requests overlapped while reserved targets stayed blocked.
  • Copy audit (§8): passed. New mise fallback messages explain the unavailable update and next action; the new waiting timeout names the problem and asks the user to check the worker and retry. Existing action labels remain unchanged. No new confirmations, empty states, glossary terms or decorative copy. Short, typical and long names remain readable; status words and action labels convey meaning without colour alone.
  • Full repository verification and builds are left to CI. Installers are exercised with isolated fixtures; no live provider CLI updates or real macOS/Windows verification were performed.

Fixes: #99
Fixes: #213

Enable updates and rollback for supported global mise shims. Keep independent
CLI actions available during bulk runs and correlate completion with the durable
installation attempt instead of stale reports or command acknowledgements.

Fixes: #99
Fixes: #213
@nixuuu
nixuuu enabled auto-merge (squash) November 18, 2026 07:41
@nixuuu
nixuuu merged commit 5ccf05d into dev Nov 18, 2026
16 checks passed
@nixuuu
nixuuu deleted the feat/automate-mise-updates branch November 18, 2026 07:52
nixuuu added a commit that referenced this pull request Nov 19, 2026
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
nixuuu added a commit that referenced this pull request Nov 21, 2026
## Summary

- Retry mise-managed Grok updates when the active npm package is newer
than the binary its launcher runs.
- Reinstall the target and allow the Grok package's setup script.
Disable aube's side-effects cache for the command so setup refreshes the
shared binary outside the package directory.
- Support the automatically detected `latest` path when it resolves to
the active global launcher. Keep the existing shim command on older
mise.

Fixes: #947

## Verification

- 57 tests passed in `mise-cli`, `update-cli-attempts`, and
`cli-discovery` via `check:tmp`.
- Worker typecheck, scoped lint, formatting, and diff check passed.
- Exercised the worker installer with real mise and the published Grok
package in an isolated Linux home. The same launcher reported `1.0.89`
before Retry and ran the published `1.0.92` binary afterward.
- Full verification runs in CI. The existing worker installation has yet
to receive the patch.
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