fix(e2e): recover current lifecycle regressions - #7650
Conversation
Signed-off-by: San Dang <sdang@nvidia.com>
📝 WalkthroughWalkthroughThe PR expands recreated-sandbox OpenShell retry handling, centralizes EXDEV E2E base-image selection, updates lifecycle staging trap behavior, and adds corresponding unit and E2E assertions. ChangesSandbox recovery
OpenClaw plugin runtime EXDEV
Lifecycle staging behavior
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Security review verdictPASS — no security findings. The PR is safe from the reviewed security perspective. The only production change broadens retry handling for one exact, same-sandbox OpenShell readiness string while preserving the existing managed-health guard, result-shape check, deadline, and terminal handling for foreign sandboxes and other phases. The remaining changes affect E2E fixtures and tests. FindingsNo findings. Detailed analysis
Files reviewed
Reviewed head: |
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
Nemotron output stays in workflow artifacts and does not change the assessment above. E2E guidanceAdvisory only. E2E / PR Gate selects and runs jobs independently. Recommended E2E: 1 optional E2E recommendation
This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
<!-- markdownlint-disable MD041 --> ## Summary Repair three current-lifecycle E2E failures from [run 30318190116](https://github.com/NVIDIA/NemoClaw/actions/runs/30318190116). Dockerfile rebuild fixtures now stage every logical `COPY` source, current EXDEV coverage keeps checkout source and sandbox base-image resolution coherent, and post-reboot recovery configures the gateway user service before restarting it. ## Changes - Parse backslash-continued Dockerfile instructions and stage every direct source from multi-source `COPY` instructions. A regression test protects the missing `package-lock.json` case while retaining traversal and secret-pattern rejection. - Replace [PR #7650](#7650 current-lifecycle EXDEV environment-only override with source-aware fixture selection. Release coverage retains the v0.0.71 source, image, and module path, while current coverage clones the checkout and validates the managed runtime's canonical OpenClaw module path. - Ensure OpenShell and the managed gateway user service are ready before post-reboot onboarding so onboarding writes the service's Docker-driver environment. Remove cleanup-time runtime restoration that overwrote primary failure artifacts, and capture bounded systemd status and journal diagnostics on health timeout. ## 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: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: the diff changes internal E2E fixtures, tests, metadata, and failure diagnostics without changing user-facing behavior or a supported product contract. - [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: Codex CLI reviewed `bc6531f6b` across the nine security categories. Result: PASS with no findings; command/path boundaries, secret-pattern rejection, managed-unit ownership guards, artifact redaction, and cleanup behavior remain constrained. The current module path is selected from a two-literal TypeScript union rather than external input. - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Documentation Writer Review - [x] Documentation writer subagent reviewed the completed changes - Result: `no-docs-needed` - Evidence: The `origin/main...bc6531f` diff remains limited to internal E2E fixtures, tests, metadata, and diagnostics. The amended test title names the managed OpenClaw module-path contract precisely. No user-facing documentation changes are needed. Biome, focused E2E-support tests, semantic phase coverage, title style, type-checking, hooks, and `git diff --check` passed. - Agent: Codex CLI <!-- docs-review-head-sha: bc6531f --> <!-- docs-review-agents-blob-sha: be20a09 --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: - Station profile/scenario: - Result: - Supporting evidence: ## 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 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: the original focused E2E-support set passed 48/48; after the E2E-discovered module-path fix, the four affected E2E-support files passed 31/31, the focused fixture passed 2/2 after the writing edit, and semantic phase coverage passed for 115 tests across 73 files. - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: `npm test` exceeded 10 minutes. Before timeout it reported unrelated environment/base-branch failures and one assertion-text mismatch fixed in `ec9f6f0f0`; the focused 48-test set then passed. Required CI will provide the broad gate. - [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) --- Signed-off-by: San Dang <sdang@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved post-reboot recovery by ensuring the OpenShell gateway CLI is available and the gateway user service is staged when missing. * Gateway health failures now surface a diagnostics artifact (including `journalctl` output) in the error for faster troubleshooting. * Improved Dockerfile base `COPY` parsing by supporting multiline instructions and better validating source tokens. * Registry target lifecycle now normalizes lifecycle profile earlier and runs post-reboot recovery prerequisites when applicable. * **Tests** * Refactored live OpenClaw plugin EXDEV flows to use resolved runtime fixtures, with stronger version/module-path assertions. * Centralized lifecycle “prepare post-reboot” setup and added coverage for the new gateway diagnostics path. * Added/updated unit tests for fixture resolution and multiline `COPY` extraction. * **Documentation** * Updated E2E manifest comments to reflect the lifecycle-driven post-reboot behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: San Dang <sdang@nvidia.com>
Summary
Recover three current-lifecycle E2E regressions from run 30283434843. Recreated sandboxes now tolerate the exact transient OpenShell
Errorphase, current-lifecycle EXDEV coverage uses the current CLI's compatible base image, and successful post-reboot service staging no longer invokes the sourced installer's process-level cleanup trap.Related Issue
Follow-up to #7618. Related to #7273 and #6108.
Changes
phase: Errorreadiness response inside the existing recreated-sandbox health guard and timeout; foreign sandboxes and other phases remain terminal.EXITtrap after successful upstream or NemoClaw service staging, while preserving rollback on staging failures.Type of Change
Quality Gates
Documentation Writer Review
no-docs-neededgit diff --check origin/main...HEADpassed.DGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run check:diffpassed when hooks were skipped or unavailablenpx vitest run --project cli src/lib/actions/sandbox/process-recovery.test.ts(41 passed); focused E2E-support tests (7 passed); fulle2e-supportproject (1,744 passed, 17 skipped).npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result:npm run docsbuilds without warnings (doc changes only)Signed-off-by: San Dang sdang@nvidia.com
Summary by CodeRabbit
Bug Fixes
Tests