Skip to content

Commit 0968dfd

Browse files
ericksoabenbarclay
andauthored
fix(hermes): scope prebaked dependencies to supported integrations (#2846)
This is a maintainer experiment that builds on Ben Barclay's PR #2834. Ben identified the right install gap: the Hermes image needs the dependencies required for supported runtime integrations, otherwise users hit missing-package failures after onboarding. This branch keeps that direction while narrowing the dependency surface for NemoClaw: - targets the selected Hermes release `v2026.4.23` / `0.11.0` - verifies the GitHub release tarball by SHA256 before extraction - installs Hermes with `uv sync --frozen --no-dev --extra messaging --extra web` by default instead of `[all]` - preserves the `/usr/local/bin/hermes` final-image contract used by policy and e2e checks - grants the Hermes gateway group write access to runtime state directories while keeping config files non-group-writable - opens `/tmp/gateway.log` from inside the `gateway` user context so capability-dropping does not block startup - updates the Hermes manifest expected version to `2026.4.23` - leaves OpenClaw dependency handling unchanged The intent is to prebake the Hermes dependencies that map to NemoClaw-supported onboarding integrations today: Telegram, Discord, Slack, and the API/health runtime. Larger or unsupported integrations should stay out of the base image and be installed by the agent workflow when enabled. Local validation completed: - `docker build --progress=plain -f agents/hermes/Dockerfile.base -t nemoclaw-hermes-base-experiment .` - `docker build --progress=plain -f agents/hermes/Dockerfile.base --build-arg HERMES_VERSION=v2026.4.13 --build-arg HERMES_TARBALL_SHA256=5e4529b8cb6e4821eb916b81517e48125109b1764d6d1e68a204a9f0ddf2d98c --build-arg HERMES_UV_EXTRAS=messaging -t nemoclaw-hermes-old-base-e2e-rebuild-test .` - `docker build --progress=plain -f agents/hermes/Dockerfile --build-arg BASE_IMAGE=nemoclaw-hermes-base-experiment -t nemoclaw-hermes-final-experiment .` - final image resolves `hermes` to `/usr/local/bin/hermes` and reports `Hermes Agent v0.11.0 (2026.4.23)` - imports present: `telegram`, `discord`, `slack_bolt`, `fastapi`, `uvicorn` - imports absent: `faster_whisper`, `mautrix`, `boto3`, `dingtalk_stream`, `lark_oapi` - entrypoint gateway health check returns `{"status":"ok","platform":"hermes-agent"}` through port `8642` - `npm test -- test/sandbox-provisioning.test.ts src/lib/agent-defs.test.ts src/lib/sandbox-version.test.ts` - `npm run validate:configs` - `npm run typecheck:cli` - `npx prek run --all-files --stage pre-push` Focused e2e passed on this branch: https://github.com/NVIDIA/NemoClaw/actions/runs/25222726016 Earlier focused e2e on this experiment found four useful issues that this branch now addresses: first the image contract expected `/usr/local/bin/hermes`, then the gateway needed writable Hermes runtime state under `/sandbox/.hermes`, then the entrypoint opened `/tmp/gateway.log` before switching to the `gateway` user. The rebuild e2e also needed its old-version fixture pinned to the matching tarball checksum and extras profile. The final OpenShell-specific blocker was that the Hermes executable is a symlink into /opt/hermes, so the Hermes policy now grants read-only access to that venv path. Related context: - Contributor PR: #2834 - Hermes version selection context: #2745 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Enhanced startup logging with improved diagnostics for troubleshooting sandbox initialization issues * Added runtime diagnostics to capture system state and logs when errors occur * **Chores** * Updated Hermes agent to v2026.4.23 * Improved build pipeline with better dependency verification and deterministic installation <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Ben Barclay <[email protected]>
1 parent b0fb2ff commit 0968dfd

10 files changed

Lines changed: 252 additions & 39 deletions

‎agents/hermes/Dockerfile‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ RUN set -eu; \
187187
"$config_dir/workspace" \
188188
"$config_dir/profiles" \
189189
"$config_dir/cache" \
190-
"$config_dir/pairing"; \
190+
"$config_dir/pairing" \
191+
"$config_dir/runtime"; \
191192
if [ -e "$data_dir" ] || [ -L "$data_dir" ]; then \
192193
echo "ERROR: legacy data dir still exists after cleanup: $data_dir" >&2; \
193194
exit 1; \
@@ -211,9 +212,28 @@ RUN set -eu; \
211212
done; \
212213
rm -rf /root/.cache/pip /sandbox/.cache \
213214
&& chown -R sandbox:sandbox /sandbox/.hermes \
215+
&& chown gateway:sandbox /sandbox/.hermes/runtime \
214216
&& chmod 750 /sandbox/.hermes \
217+
&& chmod 770 \
218+
/sandbox/.hermes/memories \
219+
/sandbox/.hermes/sessions \
220+
/sandbox/.hermes/skills \
221+
/sandbox/.hermes/plugins \
222+
/sandbox/.hermes/cron \
223+
/sandbox/.hermes/logs \
224+
/sandbox/.hermes/skins \
225+
/sandbox/.hermes/plans \
226+
/sandbox/.hermes/workspace \
227+
/sandbox/.hermes/profiles \
228+
/sandbox/.hermes/cache \
229+
/sandbox/.hermes/pairing \
230+
/sandbox/.hermes/runtime \
215231
&& chmod 640 /sandbox/.hermes/config.yaml \
216-
&& chmod 640 /sandbox/.hermes/.env
232+
&& chmod 640 /sandbox/.hermes/.env \
233+
&& for name in state.db state.db-wal state.db-shm gateway.pid gateway.lock gateway_state.json channel_directory.json; do \
234+
rm -f "/sandbox/.hermes/${name}"; \
235+
ln -s "runtime/${name}" "/sandbox/.hermes/${name}"; \
236+
done
217237

218238
# Pin config hash at build time for integrity verification at startup.
219239
RUN mkdir -p /etc/nemoclaw \

‎agents/hermes/Dockerfile.base‎

Lines changed: 60 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
# Hermes sandbox base image — expensive, rarely-changing layers.
55
#
66
# Contains: node:22-slim (OpenShell needs Node), apt packages, gosu,
7-
# user/group setup, .hermes directory structure, Hermes CLI, and PyYAML.
7+
# user/group setup, .hermes directory structure, Hermes CLI, and the
8+
# dependencies for NemoClaw-supported Hermes integrations.
89
#
910
# Mirrors the OpenClaw Dockerfile.base structure but installs Hermes
1011
# (Python-based) instead of OpenClaw (Node-based).
@@ -22,8 +23,11 @@ FROM node:22-slim@sha256:4f77a690f2f8946ab16fe1e791a3ac0667ae1c3575c3e4d0d4589e9
2223
ENV DEBIAN_FRONTEND=noninteractive
2324

2425
# Hermes version pinned for reproducibility.
25-
# Calver tag v2026.4.13 = semver 0.9.0.
26-
ARG HERMES_VERSION=v2026.4.13
26+
# Calver tag v2026.4.23 = semver 0.11.0.
27+
ARG HERMES_VERSION=v2026.4.23
28+
ARG HERMES_TARBALL_SHA256=1ee1be80a2112b7edc581770cee8858e725ba110cc423979cd7102492504bc6b
29+
ARG HERMES_UV_EXTRAS="messaging web"
30+
ARG UV_VERSION=0.11.8
2731

2832
RUN apt-get update && apt-get install -y --no-install-recommends \
2933
python3=3.11.2-1+b1 \
@@ -54,16 +58,18 @@ RUN arch="$(dpkg --print-architecture)" \
5458

5559
# Create sandbox user (matches OpenShell convention) and gateway user.
5660
# gateway is a member of the sandbox group so it can read Hermes config files
57-
# with group-read permissions while the sandbox user remains the only writer.
61+
# and write Hermes runtime state while config files remain non-group-writable.
5862
RUN groupadd -r sandbox \
5963
&& groupadd -r gateway \
6064
&& useradd -r -g gateway -G sandbox -d /sandbox -s /usr/sbin/nologin gateway \
6165
&& useradd -r -g sandbox -d /sandbox -s /bin/bash sandbox \
66+
&& usermod -a -G sandbox root \
6267
&& mkdir -p /sandbox/.nemoclaw \
6368
&& chown -R sandbox:sandbox /sandbox
6469

65-
# Create .hermes with all state subdirs directly (mutable by default).
66-
# No separate .hermes-data or symlink bridge.
70+
# Create .hermes with mutable integration dirs plus a scoped runtime dir.
71+
# Top-level gateway state names redirect into runtime so the config root can
72+
# remain non-group-writable without reintroducing the old .hermes-data bridge.
6773
RUN mkdir -p /sandbox/.hermes/memories \
6874
/sandbox/.hermes/sessions \
6975
/sandbox/.hermes/skills \
@@ -76,14 +82,52 @@ RUN mkdir -p /sandbox/.hermes/memories \
7682
/sandbox/.hermes/profiles \
7783
/sandbox/.hermes/cache \
7884
/sandbox/.hermes/pairing \
79-
&& chown -R sandbox:sandbox /sandbox/.hermes
85+
/sandbox/.hermes/runtime \
86+
&& chown -R sandbox:sandbox /sandbox/.hermes \
87+
&& chown gateway:sandbox /sandbox/.hermes/runtime \
88+
&& chmod 750 /sandbox/.hermes \
89+
&& chmod 770 \
90+
/sandbox/.hermes/memories \
91+
/sandbox/.hermes/sessions \
92+
/sandbox/.hermes/skills \
93+
/sandbox/.hermes/plugins \
94+
/sandbox/.hermes/cron \
95+
/sandbox/.hermes/logs \
96+
/sandbox/.hermes/skins \
97+
/sandbox/.hermes/plans \
98+
/sandbox/.hermes/workspace \
99+
/sandbox/.hermes/profiles \
100+
/sandbox/.hermes/cache \
101+
/sandbox/.hermes/pairing \
102+
/sandbox/.hermes/runtime \
103+
&& for name in state.db state.db-wal state.db-shm gateway.pid gateway.lock gateway_state.json channel_directory.json; do \
104+
rm -f "/sandbox/.hermes/${name}"; \
105+
ln -s "runtime/${name}" "/sandbox/.hermes/${name}"; \
106+
done
107+
108+
# Install Hermes Agent from the selected GitHub release.
109+
# The image prebakes only the extras mapped to NemoClaw-supported onboarding
110+
# integrations: messaging (Telegram, Discord, Slack) and web (API health/UI
111+
# runtime). New Hermes integrations should be installed by the agent workflow
112+
# when they are enabled rather than shipped in the base image by default.
113+
RUN pip3 install --no-cache-dir --break-system-packages "uv==${UV_VERSION}"
114+
RUN mkdir -p /opt/hermes \
115+
&& curl -fsSL "https://github.com/NousResearch/hermes-agent/archive/refs/tags/${HERMES_VERSION}.tar.gz" -o /tmp/hermes.tar.gz \
116+
&& printf '%s /tmp/hermes.tar.gz\n' "${HERMES_TARBALL_SHA256}" > /tmp/hermes.tar.gz.sha256 \
117+
&& sha256sum -c /tmp/hermes.tar.gz.sha256 \
118+
&& tar -xzf /tmp/hermes.tar.gz -C /opt/hermes --strip-components=1 \
119+
&& rm /tmp/hermes.tar.gz /tmp/hermes.tar.gz.sha256
120+
WORKDIR /opt/hermes
121+
# hadolint ignore=SC2086
122+
RUN set -eu; \
123+
set --; \
124+
for extra in ${HERMES_UV_EXTRAS}; do \
125+
set -- "$@" --extra "$extra"; \
126+
done; \
127+
uv sync --frozen --no-dev "$@" --no-cache \
128+
&& ln -sf /opt/hermes/.venv/bin/hermes /usr/local/bin/hermes \
129+
&& ln -sf /opt/hermes/.venv/bin/hermes-agent /usr/local/bin/hermes-agent \
130+
&& ln -sf /opt/hermes/.venv/bin/hermes-acp /usr/local/bin/hermes-acp
80131

81-
# Install Hermes Agent from GitHub release.
82-
# Hermes is not on PyPI — official install is via their install script or
83-
# direct pip install from the release tarball.
84-
# hadolint ignore=DL3013
85-
RUN pip3 install --no-cache-dir --break-system-packages \
86-
"hermes-agent @ https://github.com/NousResearch/hermes-agent/archive/refs/tags/${HERMES_VERSION}.tar.gz" \
87-
"pyyaml==6.0.3" \
88-
"python-telegram-bot>=21.0" \
89-
&& hermes --version
132+
ENV PATH="/usr/local/bin:/opt/hermes/.venv/bin:${PATH}"
133+
RUN /usr/local/bin/hermes --version

‎agents/hermes/manifest.yaml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ homepage: "https://github.com/NousResearch/hermes-agent"
1616
install_method: curl # curl install.sh | bash
1717
binary_path: /usr/local/bin/hermes
1818
version_command: "hermes --version"
19-
expected_version: "2026.4.8"
19+
expected_version: "2026.4.23"
2020
gateway_command: "hermes gateway run"
2121

2222
# ── Health probe ────────────────────────────────────────────────
@@ -33,8 +33,9 @@ health_probe:
3333
# etc.) can connect at http://localhost:8642/v1. Auth is via a bearer
3434
# token in the Authorization header, not a URL fragment.
3535
#
36-
# The optional `hermes dashboard` web UI (pip install hermes-agent[web])
37-
# listens on a different port and is not installed by default.
36+
# NemoClaw prebakes Hermes' `web` extra so the API/health runtime is available.
37+
# The optional `hermes dashboard` web UI listens on a different port and is not
38+
# exposed by default.
3839
dashboard:
3940
kind: api # "ui" or "api"
4041
label: "OpenAI-compatible API"

‎agents/hermes/policy-additions.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ filesystem_policy:
1717
read_only:
1818
- /usr
1919
- /lib
20+
- /opt/hermes
2021
- /proc
2122
- /dev/urandom
2223
- /app

‎agents/hermes/policy-permissive.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ filesystem_policy:
1818
read_only:
1919
- /usr
2020
- /lib
21+
- /opt/hermes
2122
- /proc
2223
- /dev/urandom
2324
- /app

‎agents/hermes/start.sh‎

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,44 @@ fi
3939
# SECURITY: Lock down PATH
4040
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
4141

42+
# ── Early stderr/stdout capture ──────────────────────────────────
43+
# Capture all entrypoint output to /tmp/nemoclaw-start.log so startup
44+
# failures before /tmp/gateway.log exists are still diagnosable.
45+
prepare_restricted_log() {
46+
local path="$1"
47+
local owner="${2:-}"
48+
local mode="${3:-600}"
49+
local dir base tmp
50+
51+
dir="$(dirname "$path")"
52+
base="$(basename "$path")"
53+
tmp="$(mktemp "${dir}/.${base}.tmp.XXXXXX")" || return 1
54+
: >"$tmp" || {
55+
rm -f "$tmp"
56+
return 1
57+
}
58+
if [ "$(id -u)" -eq 0 ] && [ -n "$owner" ] && ! chown "$owner" "$tmp"; then
59+
rm -f "$tmp"
60+
return 1
61+
fi
62+
if ! chmod "$mode" "$tmp"; then
63+
rm -f "$tmp"
64+
return 1
65+
fi
66+
if ! mv -f "$tmp" "$path"; then
67+
rm -f "$tmp"
68+
return 1
69+
fi
70+
}
71+
72+
_START_LOG="/tmp/nemoclaw-start.log"
73+
if [ "$(id -u)" -eq 0 ]; then
74+
prepare_restricted_log "$_START_LOG" root:root 600
75+
else
76+
prepare_restricted_log "$_START_LOG" "" 600
77+
fi
78+
exec > >(tee -a "$_START_LOG") 2> >(tee -a "$_START_LOG" >&2)
79+
4280
# ── Drop unnecessary Linux capabilities (shared) ────────────────
4381
drop_capabilities /usr/local/bin/nemoclaw-start "$@"
4482

@@ -77,9 +115,10 @@ PUBLIC_PORT=8642
77115
INTERNAL_PORT=18642
78116
HERMES="$(command -v hermes)" # Resolve once, use absolute path everywhere
79117

80-
# Hermes writes state files (PID, state.db, .channel_directory) directly into
81-
# HERMES_HOME alongside config. Config is mutable by default for the sandbox user
82-
# and group-readable by the gateway user. Immutability is opt-in via `shields up`.
118+
# Hermes resolves config and runtime state relative to HERMES_HOME. The config
119+
# root is mutable by the sandbox owner and readable by the gateway group, while
120+
# gateway-created top-level state is redirected to a scoped runtime directory.
121+
# Immutability is opt-in via `shields up`.
83122
HERMES_DIR="/sandbox/.hermes"
84123
HERMES_HASH_FILE="/etc/nemoclaw/hermes.config-hash"
85124

@@ -186,6 +225,11 @@ print_dashboard_urls() {
186225
echo "[gateway] Connect any OpenAI-compatible frontend to this endpoint." >&2
187226
}
188227

228+
start_gateway_log_stream() {
229+
{ tail -n +1 -F /tmp/gateway.log 2>/dev/null | sed -u 's/^/[gateway-log:] /' >&2; } &
230+
GATEWAY_LOG_TAIL_PID=$!
231+
}
232+
189233
# ── socat forwarder ──────────────────────────────────────────────
190234
# Hermes API server binds to 127.0.0.1 regardless of config (upstream bug).
191235
# OpenShell needs the port accessible on 0.0.0.0 for port forwarding.
@@ -453,9 +497,7 @@ if [ "$(id -u)" -ne 0 ]; then
453497
exec "${NEMOCLAW_CMD[@]}"
454498
fi
455499

456-
# TODO(#2277-P2): migrate to shared emit_restricted_log() helper
457-
touch /tmp/gateway.log
458-
chmod 600 /tmp/gateway.log
500+
prepare_restricted_log /tmp/gateway.log "" 600
459501

460502
# Defence-in-depth: verify /tmp file permissions before launching services.
461503
# shellcheck disable=SC2119
@@ -471,11 +513,13 @@ if [ "$(id -u)" -ne 0 ]; then
471513
nohup "$HERMES" gateway run >/tmp/gateway.log 2>&1 &
472514
GATEWAY_PID=$!
473515
echo "[gateway] hermes gateway launched (pid $GATEWAY_PID)" >&2
516+
start_gateway_log_stream
474517
# NOTE: PIDs are collected after launch; a signal arriving between trap
475518
# registration and the final append is a small race window (same as before
476519
# the shared-library refactor). Acceptable for entrypoint-level cleanup.
477520
SANDBOX_CHILD_PIDS=("$GATEWAY_PID")
478521
[ -n "${DECODE_PROXY_PID:-}" ] && SANDBOX_CHILD_PIDS+=("$DECODE_PROXY_PID")
522+
[ -n "${GATEWAY_LOG_TAIL_PID:-}" ] && SANDBOX_CHILD_PIDS+=("$GATEWAY_LOG_TAIL_PID")
479523
# shellcheck disable=SC2034 # read by cleanup_on_signal from sandbox-init.sh
480524
SANDBOX_WAIT_PID="$GATEWAY_PID"
481525
trap cleanup_on_signal SIGTERM SIGINT
@@ -498,10 +542,7 @@ if [ ${#NEMOCLAW_CMD[@]} -gt 0 ]; then
498542
fi
499543

500544
# SECURITY: Protect gateway log from sandbox user tampering
501-
# TODO(#2277-P2): migrate to shared emit_restricted_log() helper
502-
touch /tmp/gateway.log
503-
chown gateway:gateway /tmp/gateway.log
504-
chmod 600 /tmp/gateway.log
545+
prepare_restricted_log /tmp/gateway.log gateway:gateway 600
505546

506547
# Defence-in-depth: verify /tmp file permissions before launching services.
507548
# shellcheck disable=SC2119
@@ -514,14 +555,16 @@ HERMES_HOME="${HERMES_DIR}" \
514555
HTTP_PROXY="http://127.0.0.1:${DECODE_PROXY_PORT}" \
515556
https_proxy="http://127.0.0.1:${DECODE_PROXY_PORT}" \
516557
http_proxy="http://127.0.0.1:${DECODE_PROXY_PORT}" \
517-
nohup gosu gateway "$HERMES" gateway run >/tmp/gateway.log 2>&1 &
558+
nohup gosu gateway sh -c 'exec "$@" >/tmp/gateway.log 2>&1' sh "$HERMES" gateway run &
518559
GATEWAY_PID=$!
519560
echo "[gateway] hermes gateway launched as 'gateway' user (pid $GATEWAY_PID)" >&2
561+
start_gateway_log_stream
520562
# NOTE: PIDs are collected after launch; a signal arriving between trap
521563
# registration and the final append is a small race window (same as before
522564
# the shared-library refactor). Acceptable for entrypoint-level cleanup.
523565
SANDBOX_CHILD_PIDS=("$GATEWAY_PID")
524566
[ -n "${DECODE_PROXY_PID:-}" ] && SANDBOX_CHILD_PIDS+=("$DECODE_PROXY_PID")
567+
[ -n "${GATEWAY_LOG_TAIL_PID:-}" ] && SANDBOX_CHILD_PIDS+=("$GATEWAY_LOG_TAIL_PID")
525568
# shellcheck disable=SC2034 # read by cleanup_on_signal from sandbox-init.sh
526569
SANDBOX_WAIT_PID="$GATEWAY_PID"
527570
trap cleanup_on_signal SIGTERM SIGINT

‎test/e2e/test-hermes-e2e.sh‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,42 @@ section() {
5353
}
5454
info() { printf '\033[1;34m [info]\033[0m %s\n' "$1"; }
5555

56+
dump_hermes_diagnostics() {
57+
info "--- Hermes sandbox diagnostics ---"
58+
if ! command -v openshell >/dev/null 2>&1; then
59+
info "openshell is not available for sandbox diagnostics"
60+
return
61+
fi
62+
63+
local sandboxes diag_output diag_script
64+
sandboxes=$(openshell sandbox list 2>&1 || true)
65+
info "openshell sandbox list:"
66+
echo "$sandboxes" | tail -20 | while IFS= read -r line; do
67+
info " $line"
68+
done
69+
70+
if ! grep -Fq -- "$SANDBOX_NAME" <<<"$sandboxes"; then
71+
info "sandbox '${SANDBOX_NAME}' is not visible to openshell"
72+
return
73+
fi
74+
75+
diag_script='set +e'
76+
diag_script+='; echo "== identity =="; id 2>&1 || true'
77+
diag_script+='; echo "== listening sockets =="; ss -tlnp 2>&1 || ss -tln 2>&1 || true'
78+
diag_script+='; echo "== log and state paths =="; ls -ld /tmp /sandbox/.hermes /sandbox/.hermes/logs 2>&1 || true; ls -l /tmp/nemoclaw-start.log /tmp/gateway.log 2>&1 || true'
79+
diag_script+='; echo "== hermes-related processes =="'
80+
# shellcheck disable=SC2016 # script is intentionally evaluated inside the sandbox
81+
diag_script+='; for p in /proc/[0-9]*; do cmd=$(tr "\000" " " < "$p/cmdline" 2>/dev/null || true); case "$cmd" in *hermes*|*socat*|*nemoclaw-decode-proxy*) echo "$(basename "$p") $cmd" ;; esac; done'
82+
diag_script+='; echo "== /tmp/nemoclaw-start.log tail =="; tail -n 80 /tmp/nemoclaw-start.log 2>&1 || true'
83+
diag_script+='; echo "== /tmp/gateway.log tail =="; tail -n 120 /tmp/gateway.log 2>&1 || true'
84+
diag_output=$(openshell sandbox exec -n "$SANDBOX_NAME" -- sh -lc "$diag_script" 2>&1 || true)
85+
86+
echo "$diag_output" | while IFS= read -r line; do
87+
info " $line"
88+
done
89+
info "--- End Hermes sandbox diagnostics ---"
90+
}
91+
5692
# Parse chat completion response — handles both content and reasoning_content
5793
# (nemotron-3-super is a reasoning model that may put output in reasoning_content)
5894
parse_chat_content() {
@@ -196,6 +232,7 @@ if [ $install_exit -eq 0 ]; then
196232
pass "install.sh completed (exit 0)"
197233
else
198234
fail "install.sh failed (exit $install_exit)"
235+
dump_hermes_diagnostics
199236
exit 1
200237
fi
201238

0 commit comments

Comments
 (0)