fix(images): support Docker Engine gateway builds - #7622
Conversation
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughOpenClaw and Hermes Dockerfiles replace BuildKit-only payload mounts with direct ChangesDocker Engine build compatibility
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in commit 8593925 in the TypeScript / code-coverage/cliThe overall coverage in commit 8593925 in the Show a code coverage summary of the most impacted files.
Updated |
|
🌿 Preview your docs: https://nvidia-preview-pr-7622.docs.buildwithfern.com/nemoclaw |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/lib/onboard/sandbox-create-launch.test.ts (1)
397-401: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider keeping a managed-Hermes case for this fallback.
Switching
agentfrom the OpenClaw agent tonullmakes this the generic path only. The behavior actually being retired is Hermes-specific fail-fast, so a case with the managed Hermes agent would directly prove the cutover — that a local build failure now falls back to the gateway builder instead of throwing.As per path instructions, "Tests must prove that public entrypoints reach the new path and that the old path is deleted or cannot execute."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/lib/onboard/sandbox-create-launch.test.ts` around lines 397 - 401, Extend the fallback test in prepareSandboxCreateLaunchWithPrebuild to use the managed Hermes agent, not only agent: null. Assert that a local build failure reaches the gateway builder and returns the original Dockerfile without throwing, directly covering removal of the Hermes-specific fail-fast path.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Dockerfile`:
- Around line 95-106: The copied scripts lack the executable modes required by
the metadata checks. In Dockerfile lines 95-106, add a chmod 755 step for both
patch-bundled npm scripts and the node-tar image scan script copied at line
1616; in agents/hermes/Dockerfile lines 324 and 693, chmod hermes-wrapper.py and
node-tar-image-scan.mts to 755 before their respective checks.
In `@test/hermes-final-image-layout.test.ts`:
- Around line 161-185: Add a shared indexOfRequired helper that asserts each
searched needle exists before returning its index, then use it for every COPY
needle and comparison anchor in test/hermes-final-image-layout.test.ts lines
161-185, the dependency/plugin/patch/runtime lookups and anchors in
test/openclaw-final-image-layout.test.ts lines 46-49, and the RUN
check_metadata() anchor at line 74; preserve the existing ordering assertions
while preventing missing anchors from producing valid comparisons.
---
Nitpick comments:
In `@src/lib/onboard/sandbox-create-launch.test.ts`:
- Around line 397-401: Extend the fallback test in
prepareSandboxCreateLaunchWithPrebuild to use the managed Hermes agent, not only
agent: null. Assert that a local build failure reaches the gateway builder and
returns the original Dockerfile without throwing, directly covering removal of
the Hermes-specific fail-fast path.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 043ea2a4-acc7-4e11-a945-566aae5674ff
📒 Files selected for processing (11)
Dockerfileagents/hermes/Dockerfileci/source-shape-test-budget.jsondocs/changelog/2026-07-25.mdxdocs/reference/troubleshooting.mdxsrc/lib/onboard/sandbox-create-launch.test.tssrc/lib/onboard/sandbox-create-launch.tssrc/lib/onboard/sandbox-prebuild.test.tssrc/lib/onboard/sandbox-prebuild.tstest/hermes-final-image-layout.test.tstest/openclaw-final-image-layout.test.ts
💤 Files with no reviewable changes (2)
- src/lib/onboard/sandbox-create-launch.ts
- docs/reference/troubleshooting.mdx
PR Review Advisor — InformationalAdvisor assessment: Informational / low confidence Model lanes
Nemotron output stays in workflow artifacts and does not change the assessment above. E2E guidanceAdvisory only. E2E / PR Gate selects and runs jobs independently. Recommended E2E: 1 optional E2E recommendation
This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/lib/onboard/sandbox-create-launch.test.ts (1)
397-401: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAvoid bypassing the agent type in this regression test.
as anyallows this test to keep passing if the Hermes agent contract gains required fields. Use the repository’s typed Hermes fixture/factory, or construct a value that satisfies the actual agent type, so contract changes fail during type-checking instead of silently reducing test confidence.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/lib/onboard/sandbox-create-launch.test.ts` around lines 397 - 401, Replace the `agent: { name: "hermes" } as any` value in the `renders the original Dockerfile for Hermes after a local build failure` test with the repository’s typed Hermes fixture or factory, or construct a fully valid value matching the actual agent type. Preserve the test setup while ensuring future required Hermes agent fields produce type-checking failures.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/lib/onboard/sandbox-create-launch.test.ts`:
- Around line 397-401: Replace the `agent: { name: "hermes" } as any` value in
the `renders the original Dockerfile for Hermes after a local build failure`
test with the repository’s typed Hermes fixture or factory, or construct a fully
valid value matching the actual agent type. Preserve the test setup while
ensuring future required Hermes agent fields produce type-checking failures.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 63ae7c54-f89c-4d2d-8da9-ee2405bb6f5a
📒 Files selected for processing (3)
src/lib/onboard/sandbox-create-launch.test.tstest/hermes-final-image-layout.test.tstest/openclaw-final-image-layout.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- test/hermes-final-image-layout.test.ts
- test/openclaw-final-image-layout.test.ts
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/hermes-final-image-layout.test.ts`:
- Around line 164-165: Update the dockerfile assertion in the final image layout
test to normalize line continuations and detect RUN instructions
case-insensitively despite repeated whitespace. Replace the literal substring
check with instruction-level parsing or an equivalent regex that reliably
rejects any BuildKit-only mount syntax.
- Around line 151-170: Update the payload assertions in the final-stage layout
test to validate the exact approved COPY source and destination for each payload
stage, not just the count returned by stage.match. Define the expected COPY
lines or source/destination pairs alongside payloads, then assert the stage’s
COPY entries and finalStage contents match those expectations exactly while
preserving the existing per-stage copy counts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: d4350674-3faf-469e-b468-5286cd9537bd
📒 Files selected for processing (6)
Dockerfileagents/hermes/Dockerfileci/source-shape-test-budget.jsontest/hermes-final-image-layout.test.tstest/node-tar-dockerfile-contract.test.tstest/openclaw-final-image-layout.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- ci/source-shape-test-budget.json
- agents/hermes/Dockerfile
<!-- markdownlint-disable MD041 --> ## Summary `docs/changelog/2026-07-25.mdx` now includes the user-facing fixes that merged after #7607 and before the v0.0.96 tag. The follow-up covers safer bulk backup and clone restore behavior, policy and inference repairs, cleaner onboarding diagnostics, and OpenClaw base-image validation while leaving test-only and maintainer-internal merges out of the release entry. ## Changes - Document the Shields-safe `backup-all` flow from #7557 and the clone-specific restore pairing publication from #7608. - Record the Claude Code resolved-launcher policy repair from #7581, Hermes namespaced-model handling from #7604, and persisted Ollama proxy-token reuse from #7620. - Record OpenClaw immutable base-inventory validation from #7606, hidden route-only reservations from #7621, and clean invalid gateway-management errors from #7630. - Link the gateway lifecycle and snapshot authorities, retain #7622's already-merged Docker Engine wording, and exclude internal or test-only merges from the release entry. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [x] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [ ] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [x] Tests not applicable — justification: This PR changes release-entry prose only. The changelog contract test and Fern validation cover the dated entry, published routes, and rendering requirements. - [x] Docs updated for user-facing behavior changes - [ ] Docs not applicable — justification: - [ ] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [ ] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Documentation Writer Review - [x] Documentation writer subagent reviewed the completed changes - Result: `docs-updated` - Evidence: At exact PR head `29316da26`, a Codex Desktop documentation writer reviewed `docs/changelog/2026-07-25.mdx` against `AGENTS.md`, `WRITING.md`, and `docs/CONTRIBUTING.md`. The review confirmed that the full entry accurately reflects the merged user-visible behavior, retains #7622's existing wording, appropriately excludes internal and test-only PRs, and uses conforming terminology, structure, links, and release classification. It also confirmed that the review follow-ups use active third-person release-entry voice, name the actor and recovery requirement directly, and accurately preserve the trusted-backup, cached-release refresh, and local-build fallback constraints. The changelog test passed 6/6, and the docs build completed with 0 errors and 2 pre-existing hidden warnings. - Agent: Codex Desktop <!-- docs-review-head-sha: 29316da --> <!-- docs-review-agents-blob-sha: be20a09 --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: - Station profile/scenario: - Result: - Supporting evidence: ## Verification - [x] PR description includes a `Signed-off-by:` line and every commit appears as `Verified` in GitHub - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or `npm run check:diff` passed when hooks were skipped or unavailable - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: `npx vitest run test/changelog-docs.test.ts` passed 6/6 tests after the final review fix. - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: Not applicable to this prose-only changelog change. - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only) — exited 0 with 0 errors and 2 pre-existing hidden warnings after the final review fix. - [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) --- Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Expanded the changelog to clarify persistent `policy exclude`/`policy restore` behavior across rebuilds and snapshot restores, including reporting on removed endpoints and exclusion consistency. * Updated `claude-code` preset guidance to allow the npm-installed OpenShell launcher path while maintaining endpoint/HTTP method scope. * Documented hardened handling for invalid gateway-management declarations, improved gateway/agent-version diagnostics scope, and clarified onboarding/restore credential and reasoning precedence. * Tightened bulk backup/restore guidance (safety windows, approval limits, and failure recovery) and refined OpenClaw base selection to avoid incompatible cached releases and `:latest` fallback. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
<!-- markdownlint-disable MD041 --> ## Summary Hardens the Docker Engine compatibility regression tests added in #7622. The tests now reject BuildKit-only `RUN --mount` instructions across case, whitespace, line-continuation, and preceding RUN-flag variants, and pin every approved scratch-payload COPY source and destination for both OpenClaw and Hermes. ## Related Issue Follow-up to #7622. Relates to #7611. ## Changes - Parse logical Dockerfile instructions before checking for forbidden BuildKit mount syntax. - Detect `--mount` when it follows valid preceding RUN flags such as `--network` or `--security`. - Assert the exact approved COPY boundaries for every OpenClaw scratch payload stage. - Assert the exact approved COPY boundaries for every Hermes scratch payload stage. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: Test-only hardening; Dockerfiles, runtime behavior, configuration, and supported platforms are unchanged. - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [x] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: Codex exact-head security review PASS across all nine categories with no findings at candidate 354e7de; diff fingerprint `fcc6d7ec877ec1402b4397e2100cc80d647e883bdc621cb0b14ca647e3795606`. The diff changes only regression tests and does not change runtime or final-image bytes. - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Documentation Writer Review - [x] Documentation writer subagent reviewed the completed changes - Result: `no-docs-needed` - Evidence: the exact candidate 354e7de changes only the OpenClaw and Hermes final-image regression tests. It strengthens detection of forbidden BuildKit `RUN --mount` syntax after preceding RUN flags and pins approved scratch-payload COPY boundaries. Existing Docker Engine compatibility documentation remains accurate; production Dockerfiles, runtime behavior, configuration, supported platforms, and final-image contents do not change. - Agent: Codex Desktop documentation writer subagent <!-- docs-review-head-sha: 354e7de --> <!-- docs-review-agents-blob-sha: be20a09 --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: - Station profile/scenario: - Result: - Supporting evidence: ## Verification - [x] PR description includes a `Signed-off-by:` line and every commit appears as `Verified` in GitHub - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or `npm run check:diff` passed when hooks were skipped or unavailable - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: `npx vitest run --project integration test/hermes-final-image-layout.test.ts test/openclaw-final-image-layout.test.ts` — 15/15 passed at exact head `354e7de4`. - [x] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: Not applicable to this narrow test-only contract hardening; repository checks, source-shape budget, test-size budget, Biome, secret scan, CLI typecheck, and CLI build passed. - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only) - [ ] 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) --- Signed-off-by: Apurv Kumaria <akumaria@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Strengthened validation of final Docker image layouts. * Added detection to prevent unsupported BuildKit `RUN --mount` usage, including handling line continuations. * Improved verification of payload stages by asserting the exact `COPY` instruction lines and their order (not just counts). <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Apurv Kumaria <akumaria@nvidia.com> Co-authored-by: cjagwani <cjagwani@nvidia.com>
Summary
Managed OpenClaw and Hermes onboarding can now complete on Docker Engine when OpenShell uses its gateway builder. The gateway-bound Dockerfiles use legacy-compatible grouped
COPYpayloads instead of BuildKit-only bind mounts while retaining the measured cold-onboard layer budget.Related Issue
Fixes #7611
Changes
COPY.RUN --mount, pin the grouped copy counts and order, and keep package-remediation scans attached to the completed final images.Type of Change
Quality Gates
8593925bcdiff across all nine security categories. No findings were found. The change adds no inputs, dependencies, privileges, credentials, or network access; exact production-image builds preserve the final ownership, integrity, and package-scan assertions.Documentation Writer Review
docs-updateddocs/changelog/2026-07-25.mdxanddocs/reference/troubleshooting.mdx; the exact-head layer-grouping follow-up required no additional docs and passed changelog validation 6/6DGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run check:diffpassed when hooks were skipped or unavailablenpm run checks, CLI type-check through pre-push, source-shape, project-membership, test-title, test-size, Biome, hadolint, and secret-scanning checks passedDOCKER_BUILDKIT=0, including final metadata, integrity, and package-scan assertionsnpm run docsbuilds without warnings (doc changes only)Signed-off-by: Apurv Kumaria akumaria@nvidia.com
Summary by CodeRabbit
COPY-based payload boundaries.