fix(cli): recommend and run 'openshell gateway remove' on all platforms (#6569)#6570
Conversation
…ms (#6569) nemoclaw destroy gated the gateway removal command on process.platform: Linux used 'openshell gateway remove <name>' (correct), while macOS and other platforms used 'openshell gateway destroy -g <name>'. Modern OpenShell (>=0.0.44, incl. 0.0.72) has no 'gateway destroy' subcommand and rejects it as unrecognized, so: - the preserved-gateway hint recommended a command that fails on macOS (the reported symptom), and - --cleanup-gateway on macOS actually ran ONLY 'gateway destroy -g', which errors and is swallowed by ignoreError, silently leaving the gateway behind. Use 'gateway remove <name>' as the primary subcommand on every platform (matching the authoritative runOpenshell(["gateway","remove",...]) calls), keeping 'gateway destroy -g' only as a best-effort fallback for pre-0.0.44 builds. The Linux-only host gateway-process stop is unchanged. Update the tests that encoded the platform ternary and assert the hint recommends the real subcommand. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Jason Ma <jama@nvidia.com>
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughGateway cleanup now tries ChangesGateway Remove Command Fix
Estimated code review effort: 2 (Simple) | ~10 minutes 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 remains at 96%, unchanged from the TypeScript / code-coverage/cliThe overall coverage in the Show a code coverage summary of the most impacted files.
Updated |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
E2E Target RecommendationRequired E2E targets: Dispatch required E2E targets:
Full E2E target advisor summaryE2E Target AdvisorBase: Required E2E targets
Optional E2E targets
Relevant changed files
|
PR Review Advisor (Nemotron Ultra) — No blocking findingsMerge posture: No blocking advisor findings Action checklist
Test follow-ups to resolve or justifyIf these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.
This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision. |
PR Review Advisor — No blocking findingsMerge posture: No blocking advisor findings Action checklist
Test follow-ups to resolve or justifyIf these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.
This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision. |
Advisor checklist — resolved / justified
Signed-off-by: Jason Ma jama@nvidia.com |
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
E2E Target Results — ✅ All requested jobs passedRun: 29031341826
|
Exact-head runtime evidence after the
|
Co-authored-by: Jason Ma <jama@nvidia.com> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
E2E Target Results — ✅ All requested jobs passedRun: 29032327832
|
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
E2E Target Results — ❌ Some jobs failedRun: 29033232462
|
E2E Target Results — ✅ All requested jobs passedRun: 29033232462
|
Exact-head follow-up verificationHead: The three advisor findings are now covered directly:
Verification on the final tree:
The first Signed-off-by: Carlos Villela cvillela@nvidia.com |
apurvvkumaria
left a comment
There was a problem hiding this comment.
Exact head ff2958a is ready for final human merge. Normal CI is green, the required onboard-repair, onboard-resume, and sandbox-operations live jobs passed after the infrastructure retry, both refreshed advisors recommend merge_as_is, and CodeRabbit has no actionable thread.
<!-- 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 `fern-api@5.65.2` 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 <jyaunches@nvidia.com> <!-- 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 -->
…ms (NVIDIA#6569) (NVIDIA#6570) ## Summary `nemoclaw <name> destroy` gated its gateway-removal on `process.platform`: Linux used `openshell gateway remove <name>` (correct), while **macOS and other non-Linux platforms used `openshell gateway destroy -g <name>`**. Modern OpenShell (≥0.0.44, including the reporter's 0.0.72) has **no `gateway destroy` subcommand** and rejects it as `unrecognized subcommand 'destroy'`. That mistaken platform assumption caused two bugs: 1. **The reported symptom** — the preserved-gateway hint printed a command that fails on macOS: `Shared NemoClaw gateway preserved. Re-run 'openshell gateway destroy -g nemoclaw' to remove it, …` 2. **A worse, silent functional bug** — `nemoclaw destroy --cleanup-gateway` on macOS ran **only** `gateway destroy -g` (`destroy-gateway.ts`), which errors and is swallowed by `ignoreError: true`, so the gateway was **silently never removed**. Both share the same root cause: the belief that macOS OpenShell uses `gateway destroy`. The codebase's own authoritative removal calls (`onboard.ts:1184`, `gateway-destroy.ts:41`) already use `gateway remove` unconditionally. Fixes NVIDIA#6569. ## Changes - **`src/lib/actions/sandbox/destroy-gateway.ts`** — run `gateway remove <name>` (with `gateway destroy -g` as a best-effort pre-0.0.44 fallback) on **all** platforms. The Linux-only host gateway-process stop (`stopHostGatewayProcesses`) is unchanged and stays Linux-gated. - **`src/lib/actions/sandbox/destroy.ts`** — the preserved-gateway hint now unconditionally recommends `openshell gateway remove <name>`. - **`test/cli/destroy-gateway-cleanup.test.ts`** — replaced the two `process.platform === "linux" ? "gateway remove" : "gateway destroy -g"` assertions with unconditional `gateway remove` (+ `not.toContain` the `destroy -g` form), and added an assertion that the preserved-gateway hint recommends `openshell gateway remove` and never `gateway destroy`. `gateway destroy -g` remains **only** as the resilient fallback for pre-0.0.44 builds; it is never the primary command or a user-facing recommendation. ## Verification - **What was proven (local + host, unit level):** - `npx vitest run test/cli/destroy-gateway-cleanup.test.ts` → **11/11 pass** (locally and on the `ipp2-0085` verify host, Node 22.23.1). - `npx vitest run src/lib/actions/sandbox/destroy-flow.test.ts test/cli/destroy-gateway-unreachable.test.ts` → 17/17 pass. - `npx biome check` clean; `npx tsx scripts/checks/run.ts` all structural checks pass; `npm run build:cli` succeeds; `test-conditionals:scan` flags nothing in the touched test file. - The removal command is now platform-independent, so the Linux-run tests exercise the exact `gateway remove`→fallback logic macOS now uses. - **What remains:** a live `nemoclaw destroy --cleanup-gateway` on a physical **macOS** host to observe the gateway actually removed. The verify hosts are Linux (x86_64 + aarch64); the macOS-specific branch was unified with the Linux path by this change, so the behavior is fully covered by the platform-independent unit tests above. Signed-off-by: Jason Ma <jama@nvidia.com> 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved gateway teardown during sandbox destruction to try `openshell gateway remove <name>` first, and only run `openshell gateway destroy -g <name>` when removal fails. * Standardized the manual gateway cleanup hint to always use `openshell gateway remove <name>`. * **Tests** * Updated CLI cleanup tests to enforce consistent remove/destroy behavior and verify the new command order and messaging across cleanup modes and environment opt-in. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Jason Ma <jama@nvidia.com> Signed-off-by: Carlos Villela <cvillela@nvidia.com> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Carlos Villela <cvillela@nvidia.com> Co-authored-by: Apurv Kumaria <akumaria@nvidia.com>
<!-- 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 `fern-api@5.65.2` 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 <jyaunches@nvidia.com> <!-- 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
nemoclaw <name> destroygated its gateway-removal onprocess.platform: Linux usedopenshell gateway remove <name>(correct), while macOS and other non-Linux platforms usedopenshell gateway destroy -g <name>. Modern OpenShell (≥0.0.44, including the reporter's 0.0.72) has nogateway destroysubcommand and rejects it asunrecognized subcommand 'destroy'.That mistaken platform assumption caused two bugs:
Shared NemoClaw gateway preserved. Re-run 'openshell gateway destroy -g nemoclaw' to remove it, …nemoclaw destroy --cleanup-gatewayon macOS ran onlygateway destroy -g(destroy-gateway.ts), which errors and is swallowed byignoreError: true, so the gateway was silently never removed.Both share the same root cause: the belief that macOS OpenShell uses
gateway destroy. The codebase's own authoritative removal calls (onboard.ts:1184,gateway-destroy.ts:41) already usegateway removeunconditionally.Fixes #6569.
Changes
src/lib/actions/sandbox/destroy-gateway.ts— rungateway remove <name>(withgateway destroy -gas a best-effort pre-0.0.44 fallback) on all platforms. The Linux-only host gateway-process stop (stopHostGatewayProcesses) is unchanged and stays Linux-gated.src/lib/actions/sandbox/destroy.ts— the preserved-gateway hint now unconditionally recommendsopenshell gateway remove <name>.test/cli/destroy-gateway-cleanup.test.ts— replaced the twoprocess.platform === "linux" ? "gateway remove" : "gateway destroy -g"assertions with unconditionalgateway remove(+not.toContainthedestroy -gform), and added an assertion that the preserved-gateway hint recommendsopenshell gateway removeand nevergateway destroy.gateway destroy -gremains only as the resilient fallback for pre-0.0.44 builds; it is never the primary command or a user-facing recommendation.Verification
npx vitest run test/cli/destroy-gateway-cleanup.test.ts→ 11/11 pass (locally and on theipp2-0085verify host, Node 22.23.1).npx vitest run src/lib/actions/sandbox/destroy-flow.test.ts test/cli/destroy-gateway-unreachable.test.ts→ 17/17 pass.npx biome checkclean;npx tsx scripts/checks/run.tsall structural checks pass;npm run build:clisucceeds;test-conditionals:scanflags nothing in the touched test file.gateway remove→fallback logic macOS now uses.nemoclaw destroy --cleanup-gatewayon a physical macOS host to observe the gateway actually removed. The verify hosts are Linux (x86_64 + aarch64); the macOS-specific branch was unified with the Linux path by this change, so the behavior is fully covered by the platform-independent unit tests above.Signed-off-by: Jason Ma jama@nvidia.com
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
openshell gateway remove <name>first, and only runopenshell gateway destroy -g <name>when removal fails.openshell gateway remove <name>.Tests