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
11 changes: 11 additions & 0 deletions agents/hermes/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ ARG NEMOCLAW_MESSAGING_ALLOWED_IDS_B64=e30=
ARG NEMOCLAW_DISCORD_GUILDS_B64=e30=
ARG NEMOCLAW_TELEGRAM_CONFIG_B64=e30=
ARG NEMOCLAW_BUILD_ID=default
ARG NEMOCLAW_DARWIN_VM_COMPAT=0

# Promote build-args to env vars for the config generation script.
ENV NEMOCLAW_MODEL=${NEMOCLAW_MODEL} \
Expand Down Expand Up @@ -253,6 +254,16 @@ RUN sha256sum /sandbox/.hermes/config.yaml /sandbox/.hermes/.env \
&& chmod 600 /sandbox/.hermes/.config-hash \
&& chown sandbox:sandbox /sandbox/.hermes/.config-hash

# OpenShell's macOS VM backend currently remaps extracted rootfs ownership to
# the host uid/gid before startup. Hermes uses /sandbox as a read_write path, so
# that repair walks the trusted rc files too; keep this Darwin-only so Linux
# Docker-driver sandboxes retain the tighter default permissions.
RUN if [ "$NEMOCLAW_DARWIN_VM_COMPAT" = "1" ]; then \
chmod -R a+rwX /sandbox/.hermes; \
find /sandbox/.hermes -type d -exec chmod a+rwx {} +; \
chmod a+rw /sandbox/.bashrc /sandbox/.profile; \
fi

# start.sh handles privilege separation: runs as root initially, then drops
# to 'gateway' user via gosu for the agent process. See start.sh.
ENTRYPOINT ["/usr/local/bin/nemoclaw-start"]
Expand Down
8 changes: 7 additions & 1 deletion test/e2e/test-openshell-gateway-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,13 @@ exercise_macos_vm_rootfs_permission_regression() {
|| fail "onboard does not enable macOS VM rootfs compatibility for Darwin sandbox builds"
grep -q "chmod -R a+rwX /sandbox/.openclaw" Dockerfile \
|| fail "Dockerfile does not relax OpenClaw state permissions for macOS VM rootfs remapping"
pass "macOS VM sandbox builds enable rootfs ownership compatibility"
grep -q "ARG NEMOCLAW_DARWIN_VM_COMPAT=0" agents/hermes/Dockerfile \
|| fail "Hermes Dockerfile is missing the macOS VM rootfs compatibility ARG"
grep -q "chmod -R a+rwX /sandbox/.hermes" agents/hermes/Dockerfile \
|| fail "Hermes Dockerfile does not relax Hermes state permissions for macOS VM rootfs remapping"
grep -q "chmod a+rw /sandbox/.bashrc /sandbox/.profile" agents/hermes/Dockerfile \
|| fail "Hermes Dockerfile does not relax trusted rc files for macOS VM ownership repair"
pass "macOS VM sandbox builds enable OpenClaw and Hermes rootfs ownership compatibility"
}

wait_for_survivor_ready() {
Expand Down
Loading