From 911d6dd26b7dad0ee3ab8e6ec7aaa7e4df04bc62 Mon Sep 17 00:00:00 2001 From: Joakim Persson Date: Sat, 9 May 2026 17:13:22 +0200 Subject: [PATCH] smoke-test: query /usr prefix for npm ls -g The npm-prefix-on-volume fix (commit 9df126c) sets NPM_CONFIG_PREFIX=/home/developer/.pi/npm-global in the image ENV so user-installed pi packages survive container recreation. Side effect: default 'npm ls -g' now queries the user prefix, missing the baked opencode/pi/omos binaries that live in /usr. The smoke test's oh-my-opencode-slim check ran 'npm ls -g | grep ...' and started failing on validate-omos / validate-omos-with-pi after the prefix fix landed on main, even though the package itself is correctly installed and runnable. Fix: explicitly invert the prefix per-call: NPM_CONFIG_PREFIX=/usr npm ls -g --depth=0 | grep ... Other smoke checks (opencode --version, pi --version, bun --version) go through PATH which already includes /usr/bin, so they were unaffected. Only oh-my-opencode-slim was checked via npm rather than a binary-on-PATH because it's a library, not a CLI. --- scripts/smoke-test.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/smoke-test.sh b/scripts/smoke-test.sh index ca39497..e5ad8e8 100755 --- a/scripts/smoke-test.sh +++ b/scripts/smoke-test.sh @@ -185,8 +185,13 @@ if [ "$VARIANT" = "omos" ] || [ "$VARIANT" = "omos-with-pi" ]; then run "bun (omos)" "bun --version" run "bunx symlink (omos)" "test -L /usr/local/bin/bunx && readlink /usr/local/bin/bunx" # oh-my-opencode-slim is npm-installed globally (not a bun install); - # verify it shows up in the global module list. - run "oh-my-opencode-slim" "npm ls -g --depth=0 2>/dev/null | grep oh-my-opencode-slim" + # verify it shows up in the global module list. We must explicitly point + # npm at the system prefix (/usr) here: the image's NPM_CONFIG_PREFIX env + # is set to /home/developer/.pi/npm-global so user-installed packages + # land on the persistent volume — which means a default `npm ls -g` + # queries the user prefix and would miss the baked binaries even though + # they're correctly on PATH at /usr/bin. + run "oh-my-opencode-slim" "NPM_CONFIG_PREFIX=/usr npm ls -g --depth=0 2>/dev/null | grep oh-my-opencode-slim" else if docker run --rm --entrypoint="" "$IMAGE" sh -c "command -v bun" >/dev/null 2>&1; then fail "bun should NOT be in base image but was found"