feat(onboard): disable GPU sandbox passthrough by default on Jetson#3618
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughGPU sandbox configuration is factored into a new resolver and applied in onboarding. On Jetson, sandbox GPU passthrough now defaults to disabled when unset; onboarding prints a platform-specific note. A unit test validates the default and explicit opt-in behaviors. ChangesJetson GPU Sandbox Defaults
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
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)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
test/onboard.test.ts (1)
389-398: ⚡ Quick winAdd an explicit invalid-env fallback assertion for Jetson.
This test locks the unset and opt-in paths, but not the Jetson invalid-value fallback mentioned in the behavior change. Please add one assertion for an invalid value (e.g.,
"invalid"), expecting GPU to stay disabled.Suggested test addition
it("defaults to CPU sandbox on Jetson when NEMOCLAW_SANDBOX_GPU is unset", () => { const jetson = { type: "nvidia", platform: "jetson" as const }; expect(resolveSandboxGpuConfig(jetson, { env: {} }).sandboxGpuEnabled).toBe(false); + expect( + resolveSandboxGpuConfig(jetson, { env: { NEMOCLAW_SANDBOX_GPU: "invalid" } }) + .sandboxGpuEnabled, + ).toBe(false); // Explicit env opt-in still wins over the platform default. expect( resolveSandboxGpuConfig(jetson, { env: { NEMOCLAW_SANDBOX_GPU: "1" } }).sandboxGpuEnabled, ).toBe(true);🤖 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 `@test/onboard.test.ts` around lines 389 - 398, Add an assertion to the existing Jetson test that verifies an explicitly invalid NEMOCLAW_SANDBOX_GPU value falls back to GPU disabled: call resolveSandboxGpuConfig with the same jetson object and env: { NEMOCLAW_SANDBOX_GPU: "invalid" } and assert .sandboxGpuEnabled is false; place this alongside the other expectations in the "defaults to CPU sandbox on Jetson..." test so it covers the invalid-env fallback for the resolveSandboxGpuConfig behavior (use the existing symbols resolveSandboxGpuConfig, sandboxGpuEnabled).
🤖 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.ts`:
- Around line 1291-1294: The new Jetson-only passthrough logic (checking
gpu?.platform === "jetson" and setting mode = "0" when envMode === null) expands
src/lib/onboard.ts and must be moved or compacted; extract this into a small
helper under src/lib/onboard (e.g., a function like isJetsonDisableGPU(gpu,
envMode) in a new module under src/lib/onboard/) and call it from onboard.ts, or
fold the condition into an existing nearby statement (combine with the prior
gpu/envMode checks) so you avoid adding extra lines in onboard.ts — reference
the variables gpu, gpu?.platform, envMode, and mode and ensure behavior remains
identical (set mode = "0" when gpu?.platform === "jetson" && envMode === null).
---
Nitpick comments:
In `@test/onboard.test.ts`:
- Around line 389-398: Add an assertion to the existing Jetson test that
verifies an explicitly invalid NEMOCLAW_SANDBOX_GPU value falls back to GPU
disabled: call resolveSandboxGpuConfig with the same jetson object and env: {
NEMOCLAW_SANDBOX_GPU: "invalid" } and assert .sandboxGpuEnabled is false; place
this alongside the other expectations in the "defaults to CPU sandbox on
Jetson..." test so it covers the invalid-env fallback for the
resolveSandboxGpuConfig behavior (use the existing symbols
resolveSandboxGpuConfig, sandboxGpuEnabled).
🪄 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: 25769c9d-9c2f-468b-99db-e425a6822ca8
📒 Files selected for processing (2)
src/lib/onboard.tstest/onboard.test.ts
GPU sandbox passthrough through the OpenShell Docker driver currently fails on Jetson (L4T R39). Until this is fixed, default NEMOCLAW_SANDBOX_GPU to "0" on Jetson so a fresh nemoclaw onboard completes without manual host workarounds. Explicit NEMOCLAW_SANDBOX_GPU=1 or --gpu still opts in. Preflight emits a short note on Jetson explaining the default and suppresses the misleading lspci-driven "install NVIDIA drivers and the Container Toolkit" hint on a host where drivers are already installed. Move the SandboxGpuMode / SandboxGpuFlag types and the env + Jetson default + flag-override resolution into a new helper under src/lib/onboard/sandbox-gpu-mode.ts. Keeps the top-level src/lib/onboard.ts entrypoint within its line budget while the Jetson default for NEMOCLAW_SANDBOX_GPU lives in a focused module. Signed-off-by: Paritosh Dixit <paritoshd@nvidia.com>
ef40a66 to
65a1761
Compare
GPU sandbox passthrough through the OpenShell Docker driver currently fails on Jetson (L4T R39). Until this is fixed, default NEMOCLAW_SANDBOX_GPU to "0" on Jetson so a fresh nemoclaw onboard completes without manual host workarounds. Explicit NEMOCLAW_SANDBOX_GPU=1 or --gpu still opts in.
Preflight emits a short note on Jetson explaining the default and suppresses the misleading lspci-driven "install NVIDIA drivers and the Container Toolkit" hint on a host where drivers are already installed.
Summary
Related Issue
Changes
Type of Change
Verification
npx prek run --all-filespassesnpm testpassesmake docsbuilds without warnings (doc changes only)Signed-off-by: Your Name your-email@example.com
Summary by CodeRabbit
New Features
Bug Fixes
Tests