Repository navigation
feat(cli): add read-only host mounts - #8280
Conversation
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@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:
📝 WalkthroughWalkthroughThe PR adds repeated read-only host-directory mounts to onboarding. It validates mounts and platforms, enables managed Docker bind mounts, propagates mounts through creation and persistence, preserves them during rebuilds, reports them in status output, and documents their lifecycle. ChangesRead-only host mount onboarding
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested labels: Sequence Diagram(s)sequenceDiagram
participant NemoClawCLI
participant OnboardCommand
participant DockerDriverGateway
participant SandboxCreatePlan
participant SandboxRegistry
NemoClawCLI->>OnboardCommand: submit --host-mount declarations
OnboardCommand->>DockerDriverGateway: enable managed bind mounts
OnboardCommand->>SandboxCreatePlan: pass validated read-only mounts
SandboxCreatePlan->>DockerDriverGateway: generate read-only bind configuration
SandboxCreatePlan->>SandboxRegistry: store cloned mount metadata
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
|
🌿 Preview your docs: https://nvidia-preview-pr-8280.docs.buildwithfern.com/nemoclaw |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in commit ca643f4 in the TypeScript / code-coverage/cliThe overall coverage in commit ca643f4 in the Show a code coverage summary of the most impacted files.
Updated |
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
4 terminology differences from the second opinionAdvisory only. These are normalized differences from the primary terminology receipt.
2 additional E2E selections from the second opinionAdvisory only. The primary lane did not select these E2E jobs or targets.
Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests. Since last review: 0 prior items resolved · 0 still apply · 0 new items found 2 semantic terminology decisionsTerminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.
E2E guidanceAdvisory only. A maintainer can dispatch the default E2E suite for the commit under review. Recommended E2E: Manual-only E2E: 1 optional E2E recommendation
This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 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 `@src/lib/onboard/command.test.ts`:
- Around line 113-125: The test around resolve must actually pass two distinct
valid host-mount values through the public resolver boundary. Create two
temporary source directories, provide both mappings in the Linux input, and
assert both read-only hostMounts are returned; retain the Darwin rejection using
that same two-mount input and clean up both directories.
In `@src/lib/onboard/docker-driver-gateway-env.ts`:
- Line 227: Update the gateway runtime drift validation to require
NEMOCLAW_DOCKER_ENABLE_BIND_MOUNTS to be absent or disabled when the current
onboarding has no host mounts, so a reused mount-enabled process is rejected.
Add a regression test covering reuse from mount-enabled to mount-disabled
configuration, while preserving the enabled case in
docker-driver-gateway-env.ts.
In `@src/lib/onboard/machine/handlers/sandbox.ts`:
- Line 1204: Update resolveResumeDecision() and the reuseSandbox() flow to
normalize and compare this.options.hostMounts against the persisted host-mount
declaration before returning reuse. Ensure matching mounts continue reuse, while
added, removed, or changed mounts trigger recreate or fail closed, and cover all
cases in resume tests so reuse converges with buildSandboxCreateIntent().
In `@src/lib/onboard/sandbox-create-intent.ts`:
- Line 147: Preserve checkpoint fingerprint compatibility in
resolveSandboxCreateIntent by omitting hostMounts when no mounts are requested,
or by canonicalizing absent and empty hostMounts in
SandboxStateFlow.currentSandboxCreateFingerprint and
assertCheckpointCreateInputsStillMatch. Add a resume test using a pre-mount
checkpoint to verify interrupted onboarding does not report input drift.
In `@src/lib/state/onboard-session.ts`:
- Around line 470-486: Update persisted host-mount handling around the
hostMounts normalization and prepareResumeSession so invalid declarations are
rejected rather than silently filtered out. Preserve validation failures through
persisted-state recovery and make resume reject sessions containing malformed,
missing, or symlinked mounts when no replacement mounts are supplied; ensure
replacement mounts still follow the normal validation path. Add coverage for
each invalid persisted-mount case during resume.
🪄 Autofix
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: 05ba0d39-62c4-4226-99b3-df0a184aef4e
📒 Files selected for processing (39)
docs/manage-sandboxes/workspace-files.mdxdocs/reference/commands.mdxsrc/lib/actions/sandbox/rebuild-gpu-opt-out.test.tssrc/lib/actions/sandbox/rebuild-gpu-opt-out.tssrc/lib/actions/sandbox/status-flow.test.tssrc/lib/actions/sandbox/status-snapshot.tssrc/lib/actions/sandbox/status-text.tssrc/lib/actions/sandbox/status.test.tssrc/lib/onboard.tssrc/lib/onboard/command-support.tssrc/lib/onboard/command.test.tssrc/lib/onboard/command.tssrc/lib/onboard/docker-driver-gateway-config.tssrc/lib/onboard/docker-driver-gateway-env.tssrc/lib/onboard/docker-driver-gateway-launch.test.tssrc/lib/onboard/docker-driver-gateway-runtime.tssrc/lib/onboard/host-mount/host-mount.test.tssrc/lib/onboard/host-mount/index.tssrc/lib/onboard/machine/core-flow-phases.tssrc/lib/onboard/machine/handlers/gateway.tssrc/lib/onboard/machine/handlers/sandbox.tssrc/lib/onboard/machine/initial-flow-phases.tssrc/lib/onboard/sandbox-create-intent-resolution.tssrc/lib/onboard/sandbox-create-intent-types.tssrc/lib/onboard/sandbox-create-intent.tssrc/lib/onboard/sandbox-create-plan-materialization.tssrc/lib/onboard/sandbox-create-plan.test.tssrc/lib/onboard/sandbox-create-plan.tssrc/lib/onboard/sandbox-registration.test.tssrc/lib/onboard/sandbox-registration.tssrc/lib/onboard/session-bootstrap.test.tssrc/lib/onboard/session-bootstrap.tssrc/lib/onboard/types.tssrc/lib/state/onboard-session.test.tssrc/lib/state/onboard-session.tssrc/lib/state/registry.tssrc/lib/state/registry/host-mount.tssrc/lib/state/registry/types.tstest/support/status-flow-test-harness.ts
left a comment
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 `@src/lib/onboard/gateway-health-wait.ts`:
- Around line 10-29: Remove the duplicate getGatewayHealthWaitConfig
implementation from onboard.ts and import the authoritative function from
gateway-health-wait.ts, preserving a re-export only if the existing public API
requires it. Update all onboarding call sites to use this imported symbol, and
add public-boundary coverage proving fresh, resumed, repair, and failure flows
reach the module implementation.
In `@src/lib/onboard/host-mount/index.ts`:
- Around line 13-35: Update the onboarding cleanup flow around
finishOnboardTrace() to wrap trace-finalization and related cleanup in a nested
try/finally, ensuring hostMountScope.restore() is always executed even when
trace writing fails. Preserve the existing restoration behavior and use the
scope returned by beginHostMountScope().
🪄 Autofix
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: ad63b8df-3f5d-4f3a-bc5a-7d23fb1175a0
📒 Files selected for processing (5)
src/lib/onboard.tssrc/lib/onboard/gateway-health-wait.tssrc/lib/onboard/host-mount/host-mount.test.tssrc/lib/onboard/host-mount/index.tssrc/lib/onboard/session-bootstrap.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- src/lib/onboard/session-bootstrap.ts
- src/lib/onboard/host-mount/host-mount.test.ts
- src/lib/onboard.ts
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
left a comment
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@src/lib/state/registry/host-mount.ts`:
- Around line 112-119: Update both canonicalHostMounts implementations to use a
locale-independent binary total-order comparator for the combined source and
target keys instead of localeCompare(). Ensure distinct Unicode paths never
compare equal, so equivalent mount sets serialize identically regardless of
declaration order.
🪄 Autofix
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: 40dd5930-1526-418f-b1a0-c1460fd0edf8
📒 Files selected for processing (17)
src/lib/onboard/command.test.tssrc/lib/onboard/docker-driver-gateway-runtime.test.tssrc/lib/onboard/docker-driver-gateway-runtime.tssrc/lib/onboard/host-mount/host-mount.test.tssrc/lib/onboard/machine/handlers/gateway.test.tssrc/lib/onboard/machine/handlers/sandbox-resume.test.tssrc/lib/onboard/machine/handlers/sandbox-resume.tssrc/lib/onboard/machine/handlers/sandbox.tssrc/lib/onboard/resume-config.test.tssrc/lib/onboard/resume-config.tssrc/lib/onboard/sandbox-create-intent.tssrc/lib/onboard/sandbox-create-plan.test.tssrc/lib/onboard/session-bootstrap.test.tssrc/lib/onboard/session-bootstrap.tssrc/lib/state/onboard-session.test.tssrc/lib/state/onboard-session.tssrc/lib/state/registry/host-mount.ts
🚧 Files skipped from review as they are similar to previous changes (7)
- src/lib/onboard/sandbox-create-plan.test.ts
- src/lib/onboard/sandbox-create-intent.ts
- src/lib/onboard/host-mount/host-mount.test.ts
- src/lib/onboard/command.test.ts
- src/lib/onboard/session-bootstrap.ts
- src/lib/onboard/machine/handlers/sandbox.ts
- src/lib/onboard/session-bootstrap.test.ts
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
commented
Aug 5, 2026
|
Addressed the remaining automated review findings on the current head
|
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
commented
Aug 5, 2026
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
… into feat/read-only-host-mounts-8274
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
commented
Aug 11, 2026
|
The exact head c9b3534 now has locale-independent binary ordering in both canonicalizers plus swapped-order Unicode regressions across resume and persisted-registry paths. The focused host-mount/resume suite (14 tests), policy build, full pre-commit hooks, and pre-push TypeScript CLI check passed. The addressed inline thread is resolved. @cv please re-review the exact head. |
The latest PR commit uses binary total ordering in both canonicalization paths and adds swapped-order Unicode regressions; review and CI conditions now pass.
left a comment
There was a problem hiding this comment.
src/lib/onboard/command.ts:189accepts host mounts for every Linux runtime, including the portable Podman profile.src/lib/onboard/docker-driver-gateway-env.ts:243selects Podman, butsrc/lib/onboard/sandbox-create-plan-materialization.ts:26-37places host bind mounts only in the Docker configuration. Impact: onboarding can accept and persist a requested mount that the created Podman sandbox does not receive, contrary to the accepted Docker-only scope and fail-closed lifecycle requirement. Reject host mounts for non-Docker runtime providers before durable state or runtime effects, or add an equivalent authoritative capability check. Add a Podman/portable-profile rejection test. 2.src/lib/onboard/sandbox-create-plan-materialization.ts:26-37is the security boundary that emitsread_only: true, butsrc/lib/onboard/sandbox-create-plan.test.tshas no host-mount, bind-mount, or read-only assertion. Impact: a regression can create writable host access or replace the Deep Agents Code tmpfs mount without a failing test. Add focused create-plan tests that parse--driver-config-json, assert a read-only Docker bind mount, and assert coexistence with the Deep Agents Code tmpfs mount. 3.src/lib/actions/sandbox/status-snapshot.ts:671andsrc/lib/actions/sandbox/status-text.ts:207-212consume host mounts from user-editable registry state without validation. Registry persistence preserves this field unchanged. Impact: a non-array value causes an unhandled.mapfailure, and control characters in source or target strings can inject terminal output. Normalize or reject persisted host mounts before status rendering, escape unsafe terminal text, and add malformed-state and control-character regression tests.
commented
Aug 11, 2026
|
Addressed all three fresh review findings at exact head
Validation: 4 focused files / 118 tests passed; CLI build passed; repository architecture checks passed; the full staged pre-commit gate and pre-push gate passed. The push has also triggered a new exact managed-image run, replacing the prior OpenClaw forward-start failure evidence. |
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
Add repeatable, read-only host directory mounts to NemoClaw onboarding on Linux and WSL2. Before this change, users had to copy host project files into a sandbox; after it, they can explicitly expose selected existing directories below
/sandboxwhile NemoClaw validates, records, reports, and safely reuses the declarations.Related Issue
Closes #8274
Changes
nemoclaw onboard --host-mount <absolute-host-directory:/sandbox/directory>with duplicate, path-normalization, directory-existence, symlink-component, and terminal-control validation.read_only: trueand enable OpenShell's Docker bind-mount gate only for runs that require it. This gateway capability switch is needed because OpenShell rejects driver bind mounts unless the managed gateway explicitly opts in; creation-plan tests cover the merged bind/tmpfs driver configuration.Type of Change
Quality Gates
Documentation Writer Review
docs-updateddocs/manage-sandboxes/workspace-files.mdx; the independent writer reviewed all 10 files changed throughca643f4d6againstWRITING.md,docs/AGENTS.md, anddocs/CONTRIBUTING.md, and reported no remaining findings.DGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run validate:prpassed after refreshingorigin/mainwhen hooks were skipped or unavailablenpm testbuilt successfully; its all-project parallel run was stopped after widespread unrelated five-second timeouts under local host saturation, so CI is the broad test signalnpm run docsbuilds without warnings (doc changes only) — passed with 0 errors and 2 pre-existing Fern warningsSigned-off-by: Aaron Erickson aerickson@nvidia.com