fix(hermes): set file permissions so sandbox user can read copied files#2466
fix(hermes): set file permissions so sandbox user can read copied files#2466
Conversation
The Hermes Dockerfile copies generate-config.ts and the plugin directory without setting read permissions, causing EACCES when the sandbox user runs the config generation step. Add chmod after each COPY to match the pattern already used for the blueprint and startup scripts. Also add the Hermes image build to PR CI (sandbox-images-and-e2e) with permission verification checks, publish the Hermes base image from base-image.yaml, and add a resolve-hermes-base-image composite action. Fixes #2191
📝 WalkthroughWalkthroughAdds a composite GitHub Action to resolve a Hermes sandbox base image (pull or build fallback), extends CI to build/push a Hermes base image, adds a job that builds a Hermes sandbox image using the resolved base and verifies sandbox user file access, and hardens Hermes Dockerfile file permissions. Changes
Sequence DiagramsequenceDiagram
participant GH as GitHub Actions
participant Action as resolve-hermes-base-image
participant GHCR as GHCR Registry
participant Docker as Docker Build
participant Env as GITHUB_ENV
GH->>Action: invoke resolve-hermes-base-image
Action->>GHCR: attempt pull ghcr.io/nvidia/nemoclaw/hermes-sandbox-base:latest
alt pull succeeds
GHCR-->>Action: pull success
Action->>Env: write HERMES_BASE_IMAGE=ghcr.io/nvidia/nemoclaw/hermes-sandbox-base:latest
else pull fails
GHCR-->>Action: pull failed
Action->>GH: emit workflow warning
Action->>Docker: build image nemoclaw-hermes-base-local (agents/hermes/Dockerfile.base)
Docker-->>Action: build complete
Action->>Env: write HERMES_BASE_IMAGE=nemoclaw-hermes-base-local
end
Env-->>GH: HERMES_BASE_IMAGE available
GH->>Docker: build hermes sandbox image using HERMES_BASE_IMAGE
Docker->>Docker: verify sandbox user file access and Hermes binary executability
Docker-->>GH: build & validation complete
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
The previous commit renamed build-and-push to build-and-push-openclaw and removed the IMAGE_NAME env var, which risks breaking branch protection rules that reference the original job name. Restore the original OpenClaw job untouched and keep the new Hermes base image job as a purely additive change. Fixes #2191
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/base-image.yaml (1)
92-133: Decouple Hermes publishing from OpenClaw manual dispatch.
build-and-push-hermescurrently runs onworkflow_dispatchas well. Since dispatch input is OpenClaw-specific, this introduces unnecessary coupling and can fail manual OpenClaw rebuilds for Hermes-only reasons. Consider scoping Hermes publish to push-triggered runs.Proposed minimal change
build-and-push-hermes: - if: github.repository == 'NVIDIA/NemoClaw' + if: github.repository == 'NVIDIA/NemoClaw' && github.event_name == 'push'🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/base-image.yaml around lines 92 - 133, The build-and-push-hermes job is currently running for manual workflow_dispatch runs and is coupled to OpenClaw inputs; update its run condition so it only triggers on repository push events (and still restrict to the NVIDIA/NemoClaw repo). Modify the job's if expression for build-and-push-hermes to require github.event_name == 'push' (e.g., if: github.repository == 'NVIDIA/NemoClaw' && github.event_name == 'push') so Hermes publishing is skipped for workflow_dispatch/manual OpenClaw dispatches while preserving the repo guard.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/base-image.yaml:
- Around line 92-133: The build-and-push-hermes job is currently running for
manual workflow_dispatch runs and is coupled to OpenClaw inputs; update its run
condition so it only triggers on repository push events (and still restrict to
the NVIDIA/NemoClaw repo). Modify the job's if expression for
build-and-push-hermes to require github.event_name == 'push' (e.g., if:
github.repository == 'NVIDIA/NemoClaw' && github.event_name == 'push') so Hermes
publishing is skipped for workflow_dispatch/manual OpenClaw dispatches while
preserving the repo guard.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 3b946c66-fec9-4d39-b482-a16a0e1fc00a
📒 Files selected for processing (1)
.github/workflows/base-image.yaml
## Summary Refreshes user-facing docs for the last 24 hours of merged NemoClaw history and bumps the docs metadata to 0.0.29, the next version after v0.0.28. The updates are limited to behavior supported by merged PR descriptions and diffs. ## Changes - `docs/reference/commands.md`: documented `nemoclaw <name> policy-add --from-file` and `--from-dir`, including custom preset review guidance, from #2077 / commit `7720b175`. - `docs/deployment/deploy-to-remote-gpu.md`: clarified that non-loopback `CHAT_UI_URL` disables OpenClaw device pairing for remote browser-only deployments, from #2449 / commit `f5ee8a4d`. - `docs/inference/inference-options.md`: documented provider-aware credential retry validation and the NVIDIA-only `nvapi-` prefix check, from #2389 / commit `6f7f0c6d`. - `docs/inference/switch-inference-providers.md`: documented `NEMOCLAW_INFERENCE_INPUTS` for text/image-capable model metadata baked into `openclaw.json`, from #2441 / commit `f4391892`. - `docs/reference/troubleshooting.md`: added the Git certificate verification entry for proxy CA propagation through `GIT_SSL_CAINFO`, `GIT_SSL_CAPATH`, `CURL_CA_BUNDLE`, and `REQUESTS_CA_BUNDLE`, from #2345 / commit `fa0dc1ab`. - `docs/versions1.json` and `docs/project.json`: promoted docs version `0.0.29`; `docs/versions1.json` omits unpublished `0.0.26`, `0.0.27`, and `0.0.28` entries. - `.agents/skills/nemoclaw-user-*`: regenerated derived user skill references from the updated docs. - Reviewed with no extra doc changes: #2575 / `d392ec07`, #2565 / `a3231049`, #1965 / `db1ef3ca`, #1990 / `db665834`, #2495 / `7da86fa3`, #2496 / `3192f4f4`, #2490 / `8c209058`, #2487 / `1f615e2f`, #2483 / `5653d33a`, #2482 / `31c782c0`, #2464 / `23bb5703`, #2472 / `a54f9a34`, and #2437 / `6bc860d7`. - Skipped per docs policy: #2420 / `7b76df6b` touched the experimental sandbox config path listed in `docs/.docs-skip`; #2466 / `cc15689c` touched a skipped term and CI-only sandbox image files. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [x] Doc only (includes code sample changes) ## Verification <!-- Check each item you ran and confirmed. Leave unchecked items you skipped. --> - [x] `npx prek run --all-files` passes - [ ] `npm test` passes — failed locally in installer-integration tests and one onboard helper timeout; the doc-scoped hook test projects passed under `prek`. - [ ] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed - [x] Docs updated for user-facing behavior changes - [ ] `make docs` builds without warnings (doc changes only) — build succeeded, but local Sphinx emitted the existing version-switcher file read message. - [x] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) ## AI Disclosure <!-- If an AI agent authored or co-authored this PR, check the box and name the tool. Remove this section for fully human-authored PRs. --> - [x] AI-assisted — tool: Codex --- <!-- DCO sign-off required by CI. Run: git config user.name && git config user.email --> Signed-off-by: Miyoung Choi <miyoungc@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Support for custom YAML presets in policy configuration via --from-file and --from-dir. * New build-time inference input option to declare accepted modalities (text or text,image). * **Improvements** * Credential validation now offers interactive recovery: re-enter key, retry, choose another provider, or exit. * Clarified provider-specific API key prefix handling (nvapi- only applies to NVIDIA keys). * **Documentation** * TLS certificate troubleshooting for inspected networks. * Clarified remote dashboard security/device-pairing behavior; command docs updated; docs version bumped. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>
Summary
Fix Hermes Dockerfile build failure caused by missing file permissions on copied files.
The
sandboxuser could not readgenerate-config.tsor the plugin directory, causingEACCESat build time. Also add CI coverage so Hermes Dockerfile regressions are caughton every PR.
Related Issue
Fixes #2191
Changes
chmod 444on/opt/nemoclaw-generate-config.tsafter COPY (fixes the reported EACCES)chmod -R a+rXon/opt/nemoclaw-hermes-plugin/after COPY (same class of bug)build-hermes-sandbox-imagejob tosandbox-images-and-e2e.yaml— builds theHermes image on every PR and verifies file permissions with
test -r/test -xchecksresolve-hermes-base-imagecomposite action (mirrorsresolve-sandbox-base-image)build-and-push-hermesjob tobase-image.yaml— publishes Hermes base image toGHCR when
agents/hermes/Dockerfile.basechanges on mainType of Change
Verification
npx prek run --all-filespassesSigned-off-by: Aaron Erickson aerickson@nvidia.com
Summary by CodeRabbit
New Features
Chores