Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions agents/hermes/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ RUN _hermes_certifi=$(/opt/hermes/.venv/bin/python -c 'import certifi; print(cer
# placeholder rewriting, hostname-based policy enforcement, and native
# WebSocket credential rewrite at the egress boundary.
ENV HERMES_TELEGRAM_DISABLE_FALLBACK_IPS=1
ENV HERMES_TUI_DIR="/opt/hermes/ui-tui"

# Copy NemoClaw plugin for Hermes (Python-based)
COPY agents/hermes/plugin/ /opt/nemoclaw-hermes-plugin/
Expand Down
6 changes: 5 additions & 1 deletion agents/hermes/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ RUN mkdir -p /opt/hermes \
&& tar -xzf /tmp/hermes.tar.gz -C /opt/hermes --strip-components=1 \
&& rm /tmp/hermes.tar.gz /tmp/hermes.tar.gz.sha256
WORKDIR /opt/hermes
# ui-tui and web are part of the checksum-pinned Hermes release tarball.
# npm ci uses the lockfiles from that pinned tree; re-review on every
# HERMES_VERSION/HERMES_TARBALL_SHA256 bump.
# hadolint ignore=SC2086
RUN set -eu; \
set --; \
Expand All @@ -194,5 +197,6 @@ RUN set -eu; \
&& ln -sf /opt/hermes/.venv/bin/hermes-agent /usr/local/bin/hermes-agent \
&& ln -sf /opt/hermes/.venv/bin/hermes-acp /usr/local/bin/hermes-acp

ENV PATH="/usr/local/bin:/opt/hermes/.venv/bin:${PATH}"
ENV PATH="/usr/local/bin:/opt/hermes/.venv/bin:${PATH}" \
HERMES_TUI_DIR="/opt/hermes/ui-tui"
RUN /usr/local/bin/hermes --version
14 changes: 14 additions & 0 deletions agents/hermes/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ fi
# SECURITY: Lock down PATH
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Hermes' browser Chat tab shells out to the React/Ink TUI. Force it to the
# trusted prebuilt bundle baked into the image so `hermes dashboard --tui
# --skip-build` never honors a stale/user-controlled TUI path or tries to run
# npm under root-owned /opt/hermes at runtime. Remove this when upstream Hermes
# reliably discovers the prebaked ui-tui bundle without HERMES_TUI_DIR.
if [ -f /opt/hermes/ui-tui/dist/entry.js ]; then
export HERMES_TUI_DIR="/opt/hermes/ui-tui"
fi

# ── Early stderr/stdout capture ──────────────────────────────────
# Capture all entrypoint output to /tmp/nemoclaw-start.log so startup
# failures before /tmp/gateway.log exists are still diagnosable.
Expand Down Expand Up @@ -646,6 +655,11 @@ export https_proxy="$_PROXY_URL"
export no_proxy="$_NO_PROXY_VAL"
export HERMES_HOME="${HERMES_DIR}"
PROXYEOF
cat <<'TUIENVEOF'
if [ -f /opt/hermes/ui-tui/dist/entry.js ]; then
export HERMES_TUI_DIR="/opt/hermes/ui-tui"
fi
TUIENVEOF
for _ca_env_name in SSL_CERT_FILE CURL_CA_BUNDLE REQUESTS_CA_BUNDLE GIT_SSL_CAINFO; do
_ca_env_value="${!_ca_env_name:-}"
if [ -n "$_ca_env_value" ]; then
Expand Down
2 changes: 2 additions & 0 deletions test/hermes-start.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,8 @@ describe("agents/hermes/start.sh runtime shell env", () => {
expect(run.result.status).toBe(0);
expect(run.envFileMode).toBe("444");
expect(run.envFileContent).toContain(`export HERMES_HOME="${run.hermesHome}"`);
expect(run.envFileContent).toContain('export HERMES_TUI_DIR="/opt/hermes/ui-tui"');
expect(run.envFileContent).not.toContain('HERMES_TUI_DIR="${HERMES_TUI_DIR:-');
expect(run.envFileContent).toContain(`export SSL_CERT_FILE=${escapedCaFile}`);
expect(run.envFileContent).toContain("# nemoclaw-configure-guard begin");
expect(run.envFileContent).toContain("hermes() {");
Expand Down
Loading