Repository navigation
test(onboard): cover null-name resume sessions (Fixes #5783) - #5860
Conversation
📝 WalkthroughWalkthroughAdds tests for onboarding resume when a saved session has ChangesOnboard resume with null sandbox name
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/onboard-sandbox-name.test.ts (1)
242-247: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winScrub
NEMOCLAW_*env vars to keep this test hermetic.Both the seed and CLI spawns inherit the full
process.env. IfNEMOCLAW_SANDBOX_NAMEis present in the developer/CI environment,requestedSandboxNamebecomes non-null and the resume no longer hits the null-sandbox guidance path, soresult.statuswould not be1and the assertions at Lines 250-258 would fail. Other inheritedNEMOCLAW_*vars (e.g.NEMOCLAW_NON_INTERACTIVE,NEMOCLAW_AGENT) can similarly perturb behavior.Consider stripping the relevant
NEMOCLAW_*vars from the inherited env for both spawns.♻️ Example: drop interfering env vars
+ const baseEnv = { ...process.env }; + for (const key of Object.keys(baseEnv)) { + if (key.startsWith("NEMOCLAW_")) delete baseEnv[key]; + } const result = spawnSync( process.execPath, [path.join(repoRoot, "bin", "nemoclaw.js"), "onboard", "--resume", "--non-interactive"], { cwd: repoRoot, encoding: "utf-8", env: { - ...process.env, + ...baseEnv, HOME: tmpDir, NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE: "1", }, }, );Based on learnings, hermetic onboard tests in this repo should avoid inheriting CI/local
NEMOCLAW_*config that could activate alternate paths and destabilize assertions.🤖 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-sandbox-name.test.ts` around lines 242 - 247, The onboard sandbox name test is not hermetic because the seed and CLI spawns inherit all of process.env, including potentially interfering NEMOCLAW_* settings. Update the env setup used in the spawn calls in onboard-sandbox-name.test.ts to explicitly remove inherited NEMOCLAW_* variables such as NEMOCLAW_SANDBOX_NAME, NEMOCLAW_NON_INTERACTIVE, and NEMOCLAW_AGENT while still preserving the intended HOME and NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE values. Keep the fix localized to the test helpers/spawn env construction so the null-sandbox guidance path stays deterministic.Source: Learnings
🤖 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 `@test/onboard-sandbox-name.test.ts`:
- Around line 242-247: The onboard sandbox name test is not hermetic because the
seed and CLI spawns inherit all of process.env, including potentially
interfering NEMOCLAW_* settings. Update the env setup used in the spawn calls in
onboard-sandbox-name.test.ts to explicitly remove inherited NEMOCLAW_* variables
such as NEMOCLAW_SANDBOX_NAME, NEMOCLAW_NON_INTERACTIVE, and NEMOCLAW_AGENT
while still preserving the intended HOME and
NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE values. Keep the fix localized to the test
helpers/spawn env construction so the null-sandbox guidance path stays
deterministic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 95eb30e3-4691-403e-8c15-7f41972f2cbc
📒 Files selected for processing (2)
src/lib/onboard/session-bootstrap.test.tstest/onboard-sandbox-name.test.ts
|
✨ Thanks for adding regression coverage for the null Related open issues: |
|
Scrubbed inherited NEMOCLAW_* variables from the resume test env so the null-name scenario is hermetic and only opts back into the values it needs. Validation: npm run build:cli; npm run typecheck:cli; npm run lint; npx vitest run test/onboard-sandbox-name.test.ts. |
b24ce4a to
3b14e23
Compare
|
Rebased on current main and removed the compiled |
3b14e23 to
94f070a
Compare
|
Rebased on current main and refreshed the verified commits. Build, typecheck, lint/checks, conditional scan, and focused resume tests pass. |
Fixes NVIDIA#5783 Signed-off-by: Deepak Jain <[email protected]>
Signed-off-by: Deepak Jain <[email protected]>
94f070a to
207acc5
Compare
|
Rebased on current main and refreshed the verified commits. Build, typecheck, lint/checks, conditional scan, and focused resume tests pass. |
cv
left a comment
There was a problem hiding this comment.
Add a timeout and killSignal to the spawnSync regression test. The Vitest 15-second timeout cannot interrupt a blocked synchronous child, so a prompt regression can wedge the worker. Also, Fixes #5783 should not close the issue until the reported loss of web-search and name choices is addressed or explicitly split into a follow-up. Then run the full workflows and advisor.
cv
left a comment
There was a problem hiding this comment.
Reviewed the current-main head. The focused tests cover interactive resume with a null recorded sandbox name and the non-interactive failure contract with isolated environment state. All current-head CI and contributor-compliance gates are green.
prekshivyas
left a comment
There was a problem hiding this comment.
Reviewed the two regression tests and current main behavior. Interactive null-name resume remains prompt-capable; non-interactive resume exits 1 with explicit recovery guidance. Standard CI is green, the E2E Advisor requires no live targets, and the PR description now explicitly scopes out the separate lost-input scenario instead of auto-closing the broader issue.
Signed-off-by: Apurv Kumaria <[email protected]>
Signed-off-by: Carlos Villela <[email protected]>
<!-- markdownlint-disable MD041 --> ## Summary Adds the pre-tag v0.0.79 release notes entry to `docs/about/release-notes.mdx` so the release plan can be generated after docs merge. The entry summarizes the merged v0.0.79 release train across inference, diagnostics, runtime hardening, policies, onboarding recovery, and release validation. ## Changes - Added the v0.0.79 release notes section with linked follow-up documentation for OpenRouter onboarding, managed vLLM changes, completion and logging, Deep Agents runtime limits, policy updates, onboarding recovery, and release validation. - Source summary: - #6461 -> `docs/about/release-notes.mdx`: Documents OpenRouter onboarding support and links to inference/provider references. - #6271 and #6272 -> `docs/about/release-notes.mdx`: Documents shell completion and structured logging highlights. - #6465, #6539, #6570, and #6528 -> `docs/about/release-notes.mdx`: Documents status route-drift, orphaned sandbox, gateway cleanup, and DGX Spark express-install diagnostics. - #6523, #6551, #6484, #6488, #6324, and #6542 -> `docs/about/release-notes.mdx`: Documents managed vLLM, Qwen3.6 tool parser, compaction, and timeout/readiness improvements. - #6559, #6538, #6560, #6568, #6552, #6567, and #6587 -> `docs/about/release-notes.mdx`: Documents runtime, credential, proxy, PID namespace, TOML, and provider-state hardening. - #6541, #5415, #6246, #6496, and #6573 -> `docs/about/release-notes.mdx`: Documents GitHub policy, Gmail policy, MCP allowlist, WhatsApp, and messaging-variant updates. - #6253, #6572, #6444, #6536, and #5860 -> `docs/about/release-notes.mdx`: Documents onboarding resume and create-step recovery improvements. - #6508, #6527, #5506, #6588, #6446, #6447, #6582, #6296, #6367, #6397, and #6505 -> `docs/about/release-notes.mdx`: Documents docs, release-risk, and E2E validation updates. ## 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 <!-- Check exactly one tests line and one docs line. Check other lines when applicable. Add every requested justification or approval reference. --> - [ ] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [x] Tests not applicable — justification: Release-note prose only. - [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: ## Verification <!-- Check each applicable item only when supported by the requested evidence. Run targeted tests once per relevant change set and rerun after later edits or hook autofixes that can affect the tested behavior. Do not rerun hook-covered checks. --> - [x] PR description includes the DCO sign-off declaration 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: Tests not applicable, release-note prose only. - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: - [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) - [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) Docs validation note: `npm run docs:check-agent-variants && npm run docs:check-routes && git diff --check` passed. Full `npm run docs` is currently blocked before Fern validation because the pinned `[email protected]` package is unavailable from npm (`ETARGET No matching version found`). --- <!-- DCO sign-off is required in this PR description, and every commit must appear as Verified in GitHub. Run: git config user.name && git config user.email --> Signed-off-by: Julie Yaunches <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added release notes for v0.0.79 with a new summary of recent improvements, including onboarding and inference options, operator/CLI diagnostics, sandbox recovery hardening, runtime limits, network policy behavior, and release validation updates. * Added updated references and links for the latest release. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
…VIDIA#5860) ## Summary Adds regression coverage for the null `sandboxName` resume case from NVIDIA#5783. Current `main` already lets interactive resumes continue so the later onboard flow can prompt for a sandbox name, and it exits nonzero when prompting is impossible. This PR locks both behaviors down so the old `Resume requires --name flag` / `EXIT:0` path does not come back. ## Changes - `src/lib/onboard/session-bootstrap.test.ts`: covers interactive `--resume` with `sandboxName: null`, asserting bootstrap does not reject the session before prompt-capable flow can continue. - `test/onboard-sandbox-name.test.ts`: adds a child-process CLI regression that seeds an `onboard-session.json` with `sandboxName: null`, runs `nemoclaw onboard --resume --non-interactive`, and asserts exit code `1` plus the no-recorded-name guidance. ## Testing - `npm run build:cli` - passed. - `npm run typecheck:cli` - passed. - `npx vitest run src/lib/onboard/session-bootstrap.test.ts test/onboard-sandbox-name.test.ts` - passed. - `npx vitest run test/onboard-resume-provider-recovery.test.ts --testTimeout=15000` - passed. - `npx @biomejs/biome format src/lib/onboard/session-bootstrap.test.ts test/onboard-sandbox-name.test.ts` - passed. - `npm run source-shape:check` - passed outside the sandbox after the sandboxed run failed to create the local `tsx` IPC pipe with `EPERM`. - `git diff --check` - passed. ## Evidence it works - The new CLI regression writes a real null-name onboard session under a temporary `HOME`, invokes the built CLI, and verifies `EXIT:1` behavior through the process status. - A manual repro with the same seeded session also returned `EXIT:1` and printed: `Cannot resume non-interactive onboard: the previous run was interrupted before sandbox creation completed, so no sandbox name was recorded.` - Full `npm test` was attempted, but timed out after 240s in this local environment. Before the timeout, unrelated environment-sensitive failures were visible in real network probe tests under `src/lib/onboard/preflight.test.ts` and slower sandbox/policy prompt tests; the focused onboard resume checks above passed. Adds regression coverage for NVIDIA#5783; this test-only PR does not close the broader issue. Signed-off-by: Deepak Jain <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved onboarding resume behavior when a prior interactive session was saved without a sandbox name. * Interactive resume now continues in progress without error. * Non-interactive resume now fails with a more specific message explaining that sandbox creation finished without recording a sandbox name, including guidance to rerun with `--name` or set `NEMOCLAW_SANDBOX_NAME`. * **Tests** * Added coverage for the interactive vs non-interactive resume scenarios without a saved sandbox name. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Deepak Jain <[email protected]> Signed-off-by: Apurv Kumaria <[email protected]> Signed-off-by: Carlos Villela <[email protected]> Co-authored-by: Carlos Villela <[email protected]> Co-authored-by: Apurv Kumaria <[email protected]>
<!-- markdownlint-disable MD041 --> ## Summary Adds the pre-tag v0.0.79 release notes entry to `docs/about/release-notes.mdx` so the release plan can be generated after docs merge. The entry summarizes the merged v0.0.79 release train across inference, diagnostics, runtime hardening, policies, onboarding recovery, and release validation. ## Changes - Added the v0.0.79 release notes section with linked follow-up documentation for OpenRouter onboarding, managed vLLM changes, completion and logging, Deep Agents runtime limits, policy updates, onboarding recovery, and release validation. - Source summary: - NVIDIA#6461 -> `docs/about/release-notes.mdx`: Documents OpenRouter onboarding support and links to inference/provider references. - NVIDIA#6271 and NVIDIA#6272 -> `docs/about/release-notes.mdx`: Documents shell completion and structured logging highlights. - NVIDIA#6465, NVIDIA#6539, NVIDIA#6570, and NVIDIA#6528 -> `docs/about/release-notes.mdx`: Documents status route-drift, orphaned sandbox, gateway cleanup, and DGX Spark express-install diagnostics. - NVIDIA#6523, NVIDIA#6551, NVIDIA#6484, NVIDIA#6488, NVIDIA#6324, and NVIDIA#6542 -> `docs/about/release-notes.mdx`: Documents managed vLLM, Qwen3.6 tool parser, compaction, and timeout/readiness improvements. - NVIDIA#6559, NVIDIA#6538, NVIDIA#6560, NVIDIA#6568, NVIDIA#6552, NVIDIA#6567, and NVIDIA#6587 -> `docs/about/release-notes.mdx`: Documents runtime, credential, proxy, PID namespace, TOML, and provider-state hardening. - NVIDIA#6541, NVIDIA#5415, NVIDIA#6246, NVIDIA#6496, and NVIDIA#6573 -> `docs/about/release-notes.mdx`: Documents GitHub policy, Gmail policy, MCP allowlist, WhatsApp, and messaging-variant updates. - NVIDIA#6253, NVIDIA#6572, NVIDIA#6444, NVIDIA#6536, and NVIDIA#5860 -> `docs/about/release-notes.mdx`: Documents onboarding resume and create-step recovery improvements. - NVIDIA#6508, NVIDIA#6527, NVIDIA#5506, NVIDIA#6588, NVIDIA#6446, NVIDIA#6447, NVIDIA#6582, NVIDIA#6296, NVIDIA#6367, NVIDIA#6397, and NVIDIA#6505 -> `docs/about/release-notes.mdx`: Documents docs, release-risk, and E2E validation updates. ## 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 <!-- Check exactly one tests line and one docs line. Check other lines when applicable. Add every requested justification or approval reference. --> - [ ] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [x] Tests not applicable — justification: Release-note prose only. - [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: ## Verification <!-- Check each applicable item only when supported by the requested evidence. Run targeted tests once per relevant change set and rerun after later edits or hook autofixes that can affect the tested behavior. Do not rerun hook-covered checks. --> - [x] PR description includes the DCO sign-off declaration 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: Tests not applicable, release-note prose only. - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: - [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) - [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) Docs validation note: `npm run docs:check-agent-variants && npm run docs:check-routes && git diff --check` passed. Full `npm run docs` is currently blocked before Fern validation because the pinned `[email protected]` package is unavailable from npm (`ETARGET No matching version found`). --- <!-- DCO sign-off is required in this PR description, and every commit must appear as Verified in GitHub. Run: git config user.name && git config user.email --> Signed-off-by: Julie Yaunches <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added release notes for v0.0.79 with a new summary of recent improvements, including onboarding and inference options, operator/CLI diagnostics, sandbox recovery hardening, runtime limits, network policy behavior, and release validation updates. * Added updated references and links for the latest release. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
Adds regression coverage for the null
sandboxNameresume case from #5783.Current
mainalready lets interactive resumes continue so the later onboard flow can prompt for a sandbox name, and it exits nonzero when prompting is impossible. This PR locks both behaviors down so the oldResume requires --name flag/EXIT:0path does not come back.Changes
src/lib/onboard/session-bootstrap.test.ts: covers interactive--resumewithsandboxName: null, asserting bootstrap does not reject the session before prompt-capable flow can continue.test/onboard-sandbox-name.test.ts: adds a child-process CLI regression that seeds anonboard-session.jsonwithsandboxName: null, runsnemoclaw onboard --resume --non-interactive, and asserts exit code1plus the no-recorded-name guidance.Testing
npm run build:cli- passed.npm run typecheck:cli- passed.npx vitest run src/lib/onboard/session-bootstrap.test.ts test/onboard-sandbox-name.test.ts- passed.npx vitest run test/onboard-resume-provider-recovery.test.ts --testTimeout=15000- passed.npx @biomejs/biome format src/lib/onboard/session-bootstrap.test.ts test/onboard-sandbox-name.test.ts- passed.npm run source-shape:check- passed outside the sandbox after the sandboxed run failed to create the localtsxIPC pipe withEPERM.git diff --check- passed.Evidence it works
HOME, invokes the built CLI, and verifiesEXIT:1behavior through the process status.EXIT:1and printed:Cannot resume non-interactive onboard: the previous run was interrupted before sandbox creation completed, so no sandbox name was recorded.npm testwas attempted, but timed out after 240s in this local environment. Before the timeout, unrelated environment-sensitive failures were visible in real network probe tests undersrc/lib/onboard/preflight.test.tsand slower sandbox/policy prompt tests; the focused onboard resume checks above passed.Adds regression coverage for #5783; this test-only PR does not close the broader issue.
Signed-off-by: Deepak Jain [email protected]
Summary by CodeRabbit
--nameor setNEMOCLAW_SANDBOX_NAME.