Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: pin the slash-do npx install to one shared version in setup and update scripts (#9109)

[._.]/ Adam Eivycfb43b01697e
diff --git a/scripts/SLASHDO_VERSION b/scripts/SLASHDO_VERSION
new file mode 100644
index 0000000000..1454f6ed4b
--- /dev/null
+++ b/scripts/SLASHDO_VERSION
@@ -0,0 +1 @@
+4.0.1
diff --git a/scripts/slashdo-pin.test.js b/scripts/slashdo-pin.test.js
new file mode 100644
index 0000000000..186d307324
--- /dev/null
+++ b/scripts/slashdo-pin.test.js
@@ -0,0 +1,21 @@
+import { describe, it, expect } from 'vitest';
+import { readFileSync } from 'fs';
+import { dirname, join } from 'path';
+import { fileURLToPath } from 'url';
+
+const root = join(dirname(fileURLToPath(import.meta.url)), '..');
+const read = (p) => readFileSync(join(root, p), 'utf8');
+const SCRIPTS = ['setup.sh', 'setup.ps1', 'update.sh', 'update.ps1'];
+
+describe('slash-do install pin', () => {
+ it('SLASHDO_VERSION is an exact semver', () => {
+ expect(read('scripts/SLASHDO_VERSION').trim()).toMatch(/^\d+\.\d+\.\d+$/);
+ });
+
+ it.each(SCRIPTS)('%s installs the pinned version from scripts/SLASHDO_VERSION', (file) => {
+ const src = read(file);
+ expect(src).not.toMatch(/slash-do@latest/);
+ expect(src).toMatch(/scripts[\\/]SLASHDO_VERSION/);
+ expect(src).toMatch(/npx --yes "slash-do@\$\{?SlashdoVersion\}?"|npx --yes "slash-do@\$\{?SLASHDO_VERSION\}?"/i);
+ });
+});
diff --git a/setup.ps1 b/setup.ps1
index dae892eb62..d0cfbfd21c 100644
--- a/setup.ps1
+++ b/setup.ps1
@@ -97,12 +97,13 @@ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
# via npx. Failures are non-fatal — PortOS still works without the
# user-global command pool.
Write-Host ""
-Write-Host "Installing/updating slash-do commands (npx slash-do@latest)..." -ForegroundColor Yellow
+$SlashdoVersion = (Get-Content (Join-Path $PSScriptRoot "scripts/SLASHDO_VERSION") -Raw).Trim()
+Write-Host "Installing/updating slash-do commands (npx slash-do@$SlashdoVersion)..." -ForegroundColor Yellow
# Pipe "a" so slash-do's "multiple environments detected" prompt auto-selects
# all detected envs instead of hanging on readline when stdin is not a TTY.
-"a" | & npx --yes slash-do@latest
+"a" | & npx --yes "slash-do@$SlashdoVersion"
if ($LASTEXITCODE -ne 0) {
- Write-Host "⚠️ slash-do install failed — skipping (you can re-run later: npx slash-do@latest)" -ForegroundColor Yellow
+ Write-Host "⚠️ slash-do install failed — skipping (you can re-run later: npx slash-do@$SlashdoVersion)" -ForegroundColor Yellow
$global:LASTEXITCODE = 0
}
diff --git a/setup.sh b/setup.sh
index f079e9c14b..15f472e0a4 100755
--- a/setup.sh
+++ b/setup.sh
@@ -128,14 +128,15 @@ ensure_ffmpeg
# via npx. Auto-detects the installed AI environments and lays down the latest
# command set under ~/.claude/commands (or per-environment equivalent). The
# git submodule at lib/slashdo is the in-repo source for inline command loading
-# from CoS agents — `npx slash-do@latest` complements that by keeping the
+# from CoS agents — `npx slash-do@<pinned>` complements that by keeping the
# user-global command pool current. Failures are non-fatal: PortOS still works
# without the global slash commands.
-echo "Installing/updating slash-do commands (npx slash-do@latest)..."
+SLASHDO_VERSION="$(tr -d '[:space:]' < scripts/SLASHDO_VERSION)"
+echo "Installing/updating slash-do commands (npx slash-do@${SLASHDO_VERSION})..."
# Pipe "a" so slash-do's "multiple environments detected" prompt auto-selects
# all detected envs instead of hanging on readline when stdin is not a TTY.
-if ! echo a | npx --yes slash-do@latest; then
- echo "⚠️ slash-do install failed — skipping (you can re-run later: npx slash-do@latest)"
+if ! echo a | npx --yes "slash-do@${SLASHDO_VERSION}"; then
+ echo "⚠️ slash-do install failed — skipping (you can re-run later: npx slash-do@${SLASHDO_VERSION})"
fi
echo ""
diff --git a/update.ps1 b/update.ps1
index fa6823405d..b9b3e02508 100644
--- a/update.ps1
+++ b/update.ps1
@@ -448,20 +448,21 @@ if (Test-Path $migrationsScript) {
Step "migrations" "done" "Migrations complete"
# Install/update slash-do commands. Replaces the previous interactive prompt
-# with an always-on `npx slash-do@latest` call so the user-global command
+# with an always-on pinned `npx slash-do@<version>` call so the user-global command
# pool stays current across updates. Failures are non-fatal.
# Pipe "a" so slash-do's "multiple environments detected" prompt auto-selects
# all detected envs instead of hanging on readline (update.ps1 has no TTY).
+$SlashdoVersion = (Get-Content (Join-Path $RootDir "scripts/SLASHDO_VERSION") -Raw).Trim()
Step "slash-do" "running" "Installing/updating slash-do commands..."
# npx writes status to stderr; scope the same Continue downgrade as Invoke-Logged
# around this stdin-piped call so it isn't aborted by a NativeCommandError (#1811).
# $LASTEXITCODE set inside the script block still propagates to the check below.
& {
$ErrorActionPreference = 'Continue'
- "a" | & npx --yes slash-do@latest >> $UpdateLog 2>&1
+ "a" | & npx --yes "slash-do@$SlashdoVersion" >> $UpdateLog 2>&1
}
if ($LASTEXITCODE -ne 0) {
- Write-SafeHost "⚠️ slash-do install/update failed. Continuing (re-run later: npx slash-do@latest)." -ForegroundColor Yellow
+ Write-SafeHost "⚠️ slash-do install/update failed. Continuing (re-run later: npx slash-do@$SlashdoVersion)." -ForegroundColor Yellow
$global:LASTEXITCODE = 0
}
Step "slash-do" "done" "slash-do commands installed/updated"
diff --git a/update.sh b/update.sh
index 670e357a9a..c39c26ef4d 100755
--- a/update.sh
+++ b/update.sh
@@ -419,15 +419,16 @@ fi
step "migrations" "done" "Migrations complete"
# Install/update slash-do commands. Replaces the previous interactive prompt
-# with an always-on `npx slash-do@latest` call so the user-global command
+# with an always-on pinned `npx slash-do@<version>` call so the user-global command
# pool stays current across updates without user intervention. Failures are
# non-fatal — the PR Reviewer schedule task is the only consumer and it
# fails gracefully if the binary is missing.
# Pipe "a" so slash-do's "multiple environments detected" prompt auto-selects
# all detected envs instead of hanging on readline (update.sh has no TTY).
+SLASHDO_VERSION="$(tr -d '[:space:]' < "$ROOT_DIR/scripts/SLASHDO_VERSION")"
step "slash-do" "running" "Installing/updating slash-do commands..."
-if ! echo a | run npx --yes slash-do@latest; then
- log "⚠️ slash-do install/update failed. Continuing without it (re-run later: npx slash-do@latest)."
+if ! echo a | run npx --yes "slash-do@${SLASHDO_VERSION}"; then
+ log "⚠️ slash-do install/update failed. Continuing without it (re-run later: npx slash-do@${SLASHDO_VERSION})."
fi
step "slash-do" "done" "slash-do commands installed/updated"
log ""