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
fix(cli): fall back to a published release when adding hosts - #9809
Addresses the hosts add failure in #9559. When desktop ships before its matching standalone CLI archive, onboarding a remote host fails with 404.
hosts add now opts into the installer's --fallback-latest behavior: a missing pinned archive produces a warning and one attempt at cli-latest. Published pins keep their original download; other HTTP failures remain errors. Manual installer pins and update --version keep their strict behavior. Missing versioned releases still need publication by the maintainers.
The install command is extracted into the existing SSH setup helpers and the CLI reference describes the fallback.
How I tested it
The regression fails with the original installer (exit 1 after a pinned 404) and succeeds after the fix (requests pinned archive, then latest; installs the fixture binary reporting 2.0.5).
Real sh, curl, and tar run the generated remote-install command against a loopback HTTP server. Six installer cases cover missing/published pins, an explicit manual pin, HTTP 500, missing latest, and avoiding a repeated latest request. No live SSH machine or cloud registration was used. Before/after output and reproducible probe.
bun run lint:fix, clean bun run lint, all 42 typecheck tasks, docs typecheck, bun run check:i18n, and sh -n pass. No translation catalog changes.
Full bun run test --continue=always with TERM=xterm-256color: 27/30 tasks pass. Shared's macOS date-format assertion (test(shared): compare overnight recurrence slots by timestamp #9658), two unchanged agent-setup shell-wrapper tests, and three untouched host-service tests fail. The three host-service cases pass in a scoped recheck. No CI or unrelated test changes are included.
Implementation, diff inspection, and automated checks were performed with Codex. No human review or manual testing is claimed.
Checklist
PR title follows conventional commits (type(scope): subject)
bun run lint and bun run typecheck pass (CI fails on lint warnings too)
"Allow edits from maintainers" is checked on fork PRs
Fixes hosts add failing with a 404 when the desktop build ships before its matching standalone CLI archive.
hosts add now falls back to the published cli-latest release when the pinned release's archive returns 404, with a warning. Published pins keep their original download; other HTTP failures and manual installer pins remain strict.
Extracts the remote install command into a shared helper.
Adds the --fallback-latest flag to the installer and documents the fallback in the CLI reference.
Covers the fallback paths with installer tests.
Written for commit 736b1a1. Summary will update on new commits.
Summary by CodeRabbit
New Features
hosts add now installs the latest published CLI if the requested release is unavailable.
Documentation
Updated the CLI reference to describe the fallback behavior.
No actionable comments were generated in the recent review.
Walkthrough
The installer can retry a missing pinned CLI release from cli-latest when fallback is enabled. The hosts add command now uses a shared helper to run the installer remotely, and the CLI reference documents the fallback behavior.
Changes: Remote CLI installation
Layer / File(s)
Summary
Installer fallback and validation apps/marketing/public/cli/install.sh, packages/cli/src/lib/ssh-host-setup/install.test.ts, apps/docs/content/docs/cli/cli-reference.mdx
The installer retries from cli-latest when an eligible pinned release returns HTTP 404 and fallback is enabled. It parses --fallback-latest and --no-next-steps across its arguments. Tests cover fallback and failure cases, and the CLI reference describes the fallback.
installCliScript generates a remote installer script with the install directory and requested version. hosts add uses the helper to install or update the remote CLI.
sequenceDiagram
participant HostsAdd as hosts add command
participant InstallScript as installCliScript
participant RemoteInstaller as install.sh
participant PinnedArchive as Pinned release archive
participant LatestArchive as cli-latest archive
HostsAdd->>InstallScript: Generate remote installer script
InstallScript-->>HostsAdd: Return script with version and fallback options
HostsAdd->>RemoteInstaller: Run generated script remotely
RemoteInstaller->>PinnedArchive: Request pinned release archive
PinnedArchive-->>RemoteInstaller: Return HTTP 404
RemoteInstaller->>LatestArchive: Retry archive from cli-latest
LatestArchive-->>RemoteInstaller: Return installer archive
Loading
Suggested reviewers:kitenite
Merge Risk: Minimal · up to 736b1
hosts add now falls back to the latest published CLI when the matching release archive is missing. The change is narrow and tested, and no actionable merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: hosts add now falls back to a published CLI release when the requested archive is missing. It uses conventional commit format, and the changeset matches it (install.sh…
Description check
The description follows the template sections (What & why, How I tested it, Checklist). It explains the fallback behavior, what stays strict, and the reason for the change, and it lists detailed test …
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 names the main change: hosts add now falls back to a published CLI release when the requested archive is missing. It uses conventional commit format, and the changeset matches it (install.sh --fallback-latest, installCliScript used by hosts add, and tests for the fallback).
Full details: Description check
Explanation
The description follows the template sections (What & why, How I tested it, Checklist). It explains the fallback behavior, what stays strict, and the reason for the change, and it lists detailed test results. It does not link the issue as a closing reference, but it cites #9559, which is a reference to the failure. The checklist is filled in. The How I tested it section gives commands and results but no screenshots, which the template prefers only for user-visible changes; this change is CLI-internal, so that is acceptable.
Finishing Touches
Generate unit tests (beta)
Create a new PR
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
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.
What & why
Addresses the
hosts addfailure in #9559. When desktop ships before its matching standalone CLI archive, onboarding a remote host fails with 404.hosts addnow opts into the installer's--fallback-latestbehavior: a missing pinned archive produces a warning and one attempt atcli-latest. Published pins keep their original download; other HTTP failures remain errors. Manual installer pins andupdate --versionkeep their strict behavior. Missing versioned releases still need publication by the maintainers.The install command is extracted into the existing SSH setup helpers and the CLI reference describes the fallback.
How I tested it
2.0.5).sh,curl, andtarrun the generated remote-install command against a loopback HTTP server. Six installer cases cover missing/published pins, an explicit manual pin, HTTP 500, missing latest, and avoiding a repeated latest request. No live SSH machine or cloud registration was used. Before/after output and reproducible probe.bun run lint:fix, cleanbun run lint, all 42 typecheck tasks, docs typecheck,bun run check:i18n, andsh -npass. No translation catalog changes.bun run test --continue=alwayswithTERM=xterm-256color: 27/30 tasks pass. Shared's macOS date-format assertion (test(shared): compare overnight recurrence slots by timestamp #9658), two unchanged agent-setup shell-wrapper tests, and three untouched host-service tests fail. The three host-service cases pass in a scoped recheck. No CI or unrelated test changes are included.Implementation, diff inspection, and automated checks were performed with Codex. No human review or manual testing is claimed.
Checklist
type(scope): subject)bun run lintandbun run typecheckpass (CI fails on lint warnings too)Summary by cubic
Fixes
hosts addfailing with a 404 when the desktop build ships before its matching standalone CLI archive.hosts addnow falls back to the publishedcli-latestrelease when the pinned release's archive returns 404, with a warning. Published pins keep their original download; other HTTP failures and manual installer pins remain strict.--fallback-latestflag to the installer and documents the fallback in the CLI reference.Written for commit 736b1a1. Summary will update on new commits.
Summary by CodeRabbit
hosts addnow installs the latest published CLI if the requested release is unavailable.