From 349bb633ff331107d76303acb5c106e23517572c Mon Sep 17 00:00:00 2001 From: Joakim Persson Date: Wed, 29 Apr 2026 09:01:23 +0200 Subject: [PATCH] Fix OMOS bunx detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit entrypoint-user.sh gated OMOS auto-install on 'command -v bunx', but neither upstream bun installer nor our Dockerfile creates a bunx symlink — only the bun binary exists on PATH. The check always failed on a fresh OMOS image, printing 'ENABLE_OMOS=true but bun is not installed.' even though bun was right there. Latent until now because the only exercised path had a persisted oh-my-opencode-slim.json from a prior install. Fixes: - Gate on 'command -v bun' instead of bunx. - Call 'bun x oh-my-opencode-slim@latest install ...' (bun x is the real subcommand that actually works with only the bun binary). - Add 'ln -sf bun /usr/local/bin/bunx' in the Dockerfile OMOS block so interactive users can still type bunx by habit. - Smoke test asserts the bunx symlink exists on the OMOS variant. Also verify 'test -L /usr/local/bin/bunx' as a build-time sanity check. Can't use 'bunx --help' for that — bun exits 1 on help output even though it prints the usage correctly. --- CHANGELOG.md | 10 ++++++++++ Dockerfile | 2 ++ entrypoint-user.sh | 6 +++--- scripts/smoke-test.sh | 1 + 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 639e812..e1dfbed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,16 @@ Tags follow `v{opencode_version}[letter]` — bare tag for the first build on a --- +## v1.14.29b — 2026-04-29 + +**Fix OMOS `bunx` detection.** + +- **Fix:** `entrypoint-user.sh` checked `command -v bunx` to gate the OMOS auto-install, but the OMOS image only ships the `bun` binary — upstream's bun installer never creates a `bunx` symlink and neither did our Dockerfile. The check always failed on a fresh OMOS image, so `bun x oh-my-opencode-slim@latest install` never ran and first-start OMOS setup would have printed `ENABLE_OMOS=true but bun is not installed.` even though bun was right there. Latent until now because the only exercised path had a persisted `oh-my-opencode-slim.json` from a prior install. + - Changed the gate to `command -v bun`. + - Changed both install invocations from `bunx oh-my-opencode-slim@latest install ...` to `bun x oh-my-opencode-slim@latest install ...`. + - Added `ln -sf bun /usr/local/bin/bunx` to the Dockerfile's OMOS block so interactive users can still type `bunx` by habit, and verified the symlink during build. + - Smoke test now asserts the `bunx` symlink is present on the OMOS variant. + ## v1.14.29 — 2026-04-28 **Opencode 1.14.29 + infrastructure and maintainability pass.** diff --git a/Dockerfile b/Dockerfile index 27ce3b8..3f9b332 100644 --- a/Dockerfile +++ b/Dockerfile @@ -284,8 +284,10 @@ RUN if [ "${INSTALL_OMOS}" = "true" ]; then \ unzip -o /tmp/bun.zip -d /tmp/bun && \ mv /tmp/bun/bun-linux-${BUN_ARCH}/bun /usr/local/bin/bun && \ chmod +x /usr/local/bin/bun && \ + ln -sf bun /usr/local/bin/bunx && \ rm -rf /tmp/bun /tmp/bun.zip && \ bun --version && \ + test -L /usr/local/bin/bunx && \ npm install -g oh-my-opencode-slim@${OMOS_VERSION}; \ fi diff --git a/entrypoint-user.sh b/entrypoint-user.sh index 25eba57..ee2bef7 100644 --- a/entrypoint-user.sh +++ b/entrypoint-user.sh @@ -53,7 +53,7 @@ OMOS_CONFIG="$CONFIG_DIR/oh-my-opencode-slim.json" OMOS_CONFIG="$CONFIG_DIR/oh-my-opencode-slim.json" if [ "${ENABLE_OMOS:-false}" = "true" ]; then - if ! command -v bunx &>/dev/null; then + if ! command -v bun &>/dev/null; then echo "WARNING: ENABLE_OMOS=true but bun is not installed." echo "Rebuild with: docker compose build --build-arg INSTALL_OMOS=true" elif [ ! -f "$OMOS_CONFIG" ]; then @@ -70,7 +70,7 @@ if [ "${ENABLE_OMOS:-false}" = "true" ]; then OMOS_SKILLS_FLAG="no" fi - bunx oh-my-opencode-slim@latest install \ + bun x oh-my-opencode-slim@latest install \ --no-tui \ --tmux="${OMOS_TMUX_FLAG}" \ --skills="${OMOS_SKILLS_FLAG}" @@ -87,7 +87,7 @@ if [ "${ENABLE_OMOS:-false}" = "true" ]; then OMOS_SKILLS_FLAG="yes" [ "${OMOS_SKILLS:-true}" = "false" ] && OMOS_SKILLS_FLAG="no" - bunx oh-my-opencode-slim@latest install \ + bun x oh-my-opencode-slim@latest install \ --no-tui \ --tmux="${OMOS_TMUX_FLAG}" \ --skills="${OMOS_SKILLS_FLAG}" \ diff --git a/scripts/smoke-test.sh b/scripts/smoke-test.sh index 7a06da6..053d3f8 100755 --- a/scripts/smoke-test.sh +++ b/scripts/smoke-test.sh @@ -107,6 +107,7 @@ fi # bun: only in the omos variant if [ "$VARIANT" = "omos" ]; 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"