Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion bin/lib/onboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,9 @@ async function preflight() {
console.log(" ⓘ Running under WSL");
}

// OpenShell CLI
// OpenShell CLI — install if missing, upgrade if below minimum version.
// MIN_VERSION in install-openshell.sh handles the version gate; calling it
// when openshell already exists is safe (it exits early if version is OK).
let openshellInstall = { localBin: null, futureShellPathHint: null };
if (!isOpenshellInstalled()) {
console.log(" openshell CLI not found. Installing...");
Expand All @@ -1558,6 +1560,29 @@ async function preflight() {
console.error(" Install manually: https://github.com/NVIDIA/OpenShell/releases");
process.exit(1);
}
} else {
// Ensure the installed version meets the minimum required by install-openshell.sh.
// The script itself is idempotent — it exits early if the version is already sufficient.
const currentVersion = getInstalledOpenshellVersion();
if (currentVersion) {
const parts = currentVersion.split(".").map(Number);
const minParts = [0, 0, 24]; // must match MIN_VERSION in scripts/install-openshell.sh
Copy link
Copy Markdown
Contributor

@HagegeR HagegeR Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something that important might be better placed on some constant part of the code, on the first lines preferably if not in a separate config file
Even more so now that I see it's reused in other places

const needsUpgrade =
parts[0] < minParts[0] ||
(parts[0] === minParts[0] && parts[1] < minParts[1]) ||
(parts[0] === minParts[0] && parts[1] === minParts[1] && parts[2] < minParts[2]);
if (needsUpgrade) {
console.log(
` openshell ${currentVersion} is below minimum required version. Upgrading...`,
);
openshellInstall = installOpenshell();
if (!openshellInstall.installed) {
console.error(" Failed to upgrade openshell CLI.");
console.error(" Install manually: https://github.com/NVIDIA/OpenShell/releases");
process.exit(1);
}
}
}
}
console.log(
` ✓ openshell CLI: ${runCaptureOpenshell(["--version"], { ignoreError: true }) || "unknown"}`,
Expand Down
2 changes: 1 addition & 1 deletion scripts/brev-launchable-ci-cpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
set -euo pipefail

# ── Configuration ────────────────────────────────────────────────────
OPENSHELL_VERSION="${OPENSHELL_VERSION:-v0.0.20}"
OPENSHELL_VERSION="${OPENSHELL_VERSION:-v0.0.24}"
NEMOCLAW_REF="${NEMOCLAW_REF:-main}"
TARGET_USER="${SUDO_USER:-$(id -un)}"
TARGET_HOME="$(getent passwd "$TARGET_USER" | cut -d: -f6)"
Expand Down
2 changes: 1 addition & 1 deletion scripts/install-openshell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ info "Detected $OS_LABEL ($ARCH_LABEL)"

# Minimum version required for sandbox persistence across gateway restarts
# (deterministic k3s node name + workspace PVC: NVIDIA/OpenShell#739, #488)
MIN_VERSION="0.0.22"
MIN_VERSION="0.0.24"

version_gte() {
# Returns 0 (true) if $1 >= $2 — portable, no sort -V (BSD compat)
Expand Down
Loading
Loading