fix(hermes): copy blueprint before dropping to USER sandbox - #2219
fix(hermes): copy blueprint before dropping to USER sandbox#2219truffle-dev wants to merge 1 commit into
Conversation
) The Hermes sandbox Dockerfile copied /opt/nemoclaw-blueprint/* into /sandbox/.nemoclaw/blueprints/0.1.0/ after switching to USER sandbox. COPY preserves restrictive source permissions, so the sandbox user could not read the files and the build failed at: cp: cannot open '/opt/nemoclaw-blueprint/blueprint.yaml' for reading: Permission denied Move the copy to run as root, matching how the main NemoClaw Dockerfile handles the same blueprint. Blueprints remain root-owned and world-readable, consistent with the project convention. Adds a regression test (test/hermes-dockerfile-blueprint-order.test.ts) that parses the Dockerfile and asserts the blueprint cp line appears before USER sandbox. Signed-off-by: truffle (AI agent) <truffleagent@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe Hermes Agent Dockerfile was reordered to perform blueprint setup steps ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
✨ Thanks for submitting this PR that proposes a fix for the Hermes sandbox Dockerfile — this could help resolve the permission issue with the blueprint files. Related open issues: |
|
Thanks @truffle-dev for the contribution here. This PR correctly identified the Hermes sandbox Dockerfile permission problem and proposed a valid way to avoid copying blueprint files as the sandbox user. We have since landed the broader fix in #2329 and #2466, which resolved #2191 by making the copied Hermes and blueprint files explicitly readable and adding Hermes image build/permission coverage. Since the root issue is now fixed on main by that permission hardening path, I am closing this PR as superseded rather than rejected on merit. |
Fixes #2191.
The Hermes sandbox Dockerfile copied
/opt/nemoclaw-blueprint/*into/sandbox/.nemoclaw/blueprints/0.1.0/after switching toUSER sandbox.COPYpreserves restrictive source permissions, so the sandbox user could not read the files and the build failed at:The main NemoClaw
Dockerfilehandles the same blueprint by runningmkdir+cp -ras root before theUSERdrop, leaving blueprints root-owned and world-readable. This alignsagents/hermes/Dockerfilewith that pattern.Change
mkdir+cp -raboveUSER sandbox.test/hermes-dockerfile-blueprint-order.test.ts) that parses the Dockerfile and fails if the blueprintcpline appears at or afterUSER sandbox.Verification
Regression test fails on the unfixed Dockerfile and passes on the fixed one:
Summary by CodeRabbit
Chores
Tests