From 76f5163ec68130d17ebe62a573e24147c99972a3 Mon Sep 17 00:00:00 2001 From: Joe Danziger <1423777+joedanz@users.noreply.github.com> Date: Fri, 30 Oct 2026 07:07:38 -0400 Subject: [PATCH] fix(agents-box): install the m365 CLI under /usr/local so hermes v0.22 builds From hermes v0.22 the base image bundles Node under /opt/hermes/tools/node-*/ and npm's global prefix points there, off PATH. A bare `npm install -g` put `m365` in that bin dir and `m365 --version` failed with 127, which failed the fleet's upgrade-hermes rebuild to v0.22.5. Pin `--prefix /usr/local`, the old default, on PATH in every base image. Verified: built against nousresearch/hermes-agent:v0.22.5 on helm-agents (scratch tag); m365 v11.10.0 at /usr/local/bin/m365, openpyxl 3.1.5, serve /api/status answers 0.22.5. Claude-Session: https://claude.ai/code/session_01LdXVKJurmhkcFxdUJBLKcr --- CHANGELOG.md | 7 +++++++ deploy/agents-box/Dockerfile | 11 ++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c93e81d4..d709f4c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,13 @@ explicitly under **Changed**, with what to do about it. ## [Unreleased] +### Fixed + +- The agents image builds on hermes v0.22 again. From v0.22 the hermes base image + bundles its own Node, and npm's global prefix moved there, off `PATH`, so the + `m365` CLI install failed the build with exit 127. The Dockerfile now installs it + with `--prefix /usr/local`, which works on every base image. + ## [0.9.0] - 2026-10-06 ### Added diff --git a/deploy/agents-box/Dockerfile b/deploy/agents-box/Dockerfile index 19c16819..000b25f9 100644 --- a/deploy/agents-box/Dockerfile +++ b/deploy/agents-box/Dockerfile @@ -81,8 +81,13 @@ RUN uv venv /opt/brainkit --python 3.13 \ # # NOT into /opt/data. That is the runtime volume, so anything written there at # build time is masked the moment the volume mounts — the same trap the TMPDIR -# comment above describes. The default global prefix (/usr/local) is baked into -# the image and survives. +# comment above describes. /usr/local is baked into the image and survives. +# +# `--prefix /usr/local` is explicit because the default moved: from hermes +# v0.22 the base image bundles its own Node under /opt/hermes/tools/node-*/ and +# npm's global prefix points THERE, so a bare `-g` lands `m365` in a bin dir +# that is not on PATH and `m365 --version` fails with 127 (the v0.22.5 upgrade +# build, 2026-10-30). /usr/local/bin is on PATH in every base image. # # Note for whoever migrates an agent that had this hand-installed: the runtime # PATH puts /opt/data/.local/bin BEFORE /usr/local/bin, so a hand-installed @@ -90,7 +95,7 @@ RUN uv venv /opt/brainkit --python 3.13 \ # is a fiction. ARG M365_CLI_VERSION=11.10.0 LABEL io.deploy.m365-cli-version="$M365_CLI_VERSION" -RUN npm install -g --no-fund --no-audit "@pnp/cli-microsoft365@${M365_CLI_VERSION}" \ +RUN npm install -g --prefix /usr/local --no-fund --no-audit "@pnp/cli-microsoft365@${M365_CLI_VERSION}" \ && m365 --version >/dev/null # Suppresses the CLI's update check. Not cosmetic: the nag prints on stdout,