Skip to content

fix(cli): remove stopped sandbox before Hermes volume - #10374

Merged
senthilr-nv merged 7 commits into
mainfrom
codex/fix-hermes-uninstall-volume-order
Aug 27, 2026
Merged

senthilr-nv merged 7 commits into
mainfrom
codex/fix-hermes-uninstall-volume-order

Conversation

@senthilr-nv

@senthilr-nv senthilr-nv commented Aug 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Uninstall now removes NemoClaw-owned stopped Docker sandbox containers before it removes a managed Hermes state volume. Previously, an unreachable OpenShell gateway could leave a stopped container attached to the volume, which stopped nemoclaw uninstall --yes --destroy-user-data before CLI and state cleanup.

Changes

  • Run the existing ownership-filtered Docker container cleanup before managed Hermes state volume cleanup during an unscoped uninstall.
  • Preserve the existing failure result: foreign containers remain, and NemoClaw state remains available for an exact uninstall retry when the volume cannot be removed.
  • Add regression coverage for both an owned stopped sandbox container and a foreign container attached to the volume.
  • Close the detection gap in the previous test harness, which did not model a stopped container that kept the volume in use.

Type of Change

  • 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

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests 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: Destructive cleanup still uses the existing Docker name and image ownership filter. The negative regression test confirms that a foreign container remains and uninstall preserves retry state.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit:
  • Station profile/scenario:
  • Result:
  • Supporting evidence:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: npx vitest run --project cli src/lib/actions/uninstall/run-plan-hermes-state-volume.test.ts src/lib/actions/uninstall/run-plan-docker-scope.test.ts — 2 files and 12 tests passed.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result:
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Senthil Ravichandran [email protected]

Summary by CodeRabbit

  • Bug Fixes
    • Improved OpenShell cleanup by removing managed Hermes containers before their associated state volumes.
    • Preserved state volumes when removal is blocked by remaining containers.
    • Ensured externally owned containers remain untouched during cleanup.
    • Improved handling when Docker is unavailable or cleanup is otherwise restricted.

@senthilr-nv senthilr-nv self-assigned this Aug 26, 2026
@copy-pr-bot

copy-pr-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7ec4edd3-2c29-4484-a0c8-1c403d14854f

📥 Commits

Reviewing files that changed from the base of the PR and between f15c80d and c8723d1.

📒 Files selected for processing (3)
  • src/lib/actions/uninstall/hermes-uninstall-cleanup.ts
  • src/lib/actions/uninstall/run-plan-hermes-state-volume.test.ts
  • src/lib/actions/uninstall/run-plan.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/lib/actions/uninstall/hermes-uninstall-cleanup.ts
  • src/lib/actions/uninstall/run-plan-hermes-state-volume.test.ts
  • src/lib/actions/uninstall/run-plan.ts

Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review.


📝 Walkthrough

Walkthrough

The uninstall flow removes owned Hermes containers before eligible managed Hermes state volumes. Tests model owned and foreign containers and verify cleanup ordering and blocked volume removal.

Changes

Hermes uninstall cleanup

Layer / File(s) Summary
Container cleanup orchestration
src/lib/actions/uninstall/hermes-uninstall-cleanup.ts, src/lib/actions/uninstall/run-plan.ts
The cleanup module re-exports requiresManagedHermesStateVolume. During full local cleanup, the uninstall plan removes owned Docker containers before eligible managed Hermes state volumes.
Container-aware cleanup validation
src/lib/actions/uninstall/run-plan-hermes-state-volume.test.ts
The test harness models absent, foreign, and owned containers. Tests verify forced removal of owned containers, preservation of foreign containers, and blocked volume removal.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to c8723

The uninstall flow now removes owned stopped sandbox containers before the managed Hermes volume, preserving retry state when foreign containers remain. No actionable merge-blocking risk remains after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant UninstallPlan
  participant Docker
  participant HermesVolumes
  UninstallPlan->>Docker: Remove owned Hermes containers
  Docker-->>UninstallPlan: Return removal result
  UninstallPlan->>HermesVolumes: Remove managed Hermes state volumes
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: removing stopped sandbox containers before deleting the Hermes state volume.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-hermes-uninstall-volume-order

Comment @coderabbitai help to get the list of available commands.

@github-code-quality

github-code-quality Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall line coverage in commit c8723d1 in the codex/fix-hermes-uni... branch remains at 96%, unchanged from commit f15c80d in the main branch.


Updated August 27, 2026 02:32 UTC

@senthilr-nv senthilr-nv added integration: hermes Hermes integration behavior area: install Install, setup, prerequisites, or uninstall flow area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression platform: container Affects Docker, containerd, Podman, or images security v0.0.115 labels Aug 26, 2026
@senthilr-nv
senthilr-nv marked this pull request as ready for review August 26, 2026 14:57
@senthilr-nv
senthilr-nv requested a review from sandl99 August 26, 2026 14:58
@senthilr-nv
senthilr-nv enabled auto-merge (squash) August 26, 2026 15:16
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@senthilr-nv
senthilr-nv merged commit ef9f7df into main Aug 27, 2026
69 checks passed
@senthilr-nv
senthilr-nv deleted the codex/fix-hermes-uninstall-volume-order branch August 27, 2026 02:33
@github-actions

Copy link
Copy Markdown
Contributor

PR review advisory complete for commit c8723d1: read the full review. Read it before deciding whether to request changes, approve, or merge this PR.

All previous runs

prekshivyas added a commit that referenced this pull request Aug 27, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Restore exact-source managed-image catalog selection during ordinary
onboarding.
Before this change, exact source installs ignored the installed build
revision and
requested the release alias `v0.1.0`, which is unavailable for the
tested PR commit.

This restores the behavior accepted in #10320 after #10332 removed the
orchestration
call and its regression test while leaving the revision resolver in
place.

## Changes

- Pass the installed source revision to managed-image catalog resolution
for ordinary
  exact-source onboarding.
- Preserve live E2E revision, live catalog, temporary catalog, and
rebuild authority.
- Restore an orchestration test that fails if exact-source revision
selection is
  removed again.
- Trigger the main managed-image publisher when the catalog selector
changes, so
  the merged source revision receives a matching immutable catalog.
- Extend the workflow boundary contract to protect that exact trigger
path.

## 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:
- [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: This restores the exact selection
path
accepted in #10320 without changing the build-identity resolver or
precedence.
  Prior sensitive-path approval:

#10320 (review)
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name,
  approval link, and follow-up issue:

## DGX Station Hardware Evidence

- [ ] Tested on DGX Station
- Tested commit: Not applicable; `scripts/prepare-dgx-station-host.sh`
is unchanged.
- Station profile/scenario: Not applicable.
- Result: Not applicable.
- Supporting evidence: Not applicable.

## 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 validate:pr` passed after refreshing `origin/main` when hooks
were skipped
  or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not
  applicable above — `npx vitest run --project cli
  src/lib/onboard/managed-workload/onboard-orchestration.test.ts
  src/lib/onboard/sandbox-workload-preparation.test.ts` passed 47 tests;
base-image publication E2E-support tests passed 99 tests; the
managed-image
  publication workflow integration test passed 35 tests;
  `npm run typecheck:cli` passed
- [ ] Applicable broad gate passed — not applicable to this focused
catalog-selection
and publication-trigger regression fix; targeted tests and all normal
hooks 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)

### Physical Brev reproduction

A clean Ubuntu 22.04 L40S instance installed PR #10374 commit
`9621bb06da4ddb2e382f780eaf862154f48fa80e`. Standard Hermes onboarding
stopped
before sandbox creation because it requested managed image catalog
`v0.1.0`; the
GHCR manifest returned HTTP 404. The installed source revision was exact
and the
onboarding registry recorded one partial row. No credential, IP address,
or raw log
is attached to this PR.

---

Signed-off-by: Senthil Ravichandran <[email protected]>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved managed workload onboarding to reliably use the installed
catalog revision when no newer configuration or rebuild handoff is
available.
* Prevented conflicting live revision and catalog settings from being
accepted simultaneously.
* Preserved the exact installation reference during onboarding outside
GitHub Actions.
* Updated managed image publishing to respond when onboarding
orchestration changes, helping keep published images aligned with the
latest behavior.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Senthil Ravichandran <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Prekshi Vyas <[email protected]>
@wscurran wscurran added area: security Security controls, permissions, secrets, or hardening and removed security labels Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: install Install, setup, prerequisites, or uninstall flow area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery area: security Security controls, permissions, secrets, or hardening bug-fix PR fixes a bug or regression integration: hermes Hermes integration behavior platform: container Affects Docker, containerd, Podman, or images

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants