Skip to content

fix(e2e): recover current lifecycle regressions - #7650

Merged
cv merged 1 commit into
mainfrom
codex/fix-e2e-recovery-regressions
Jul 27, 2026
Merged

fix(e2e): recover current lifecycle regressions#7650
cv merged 1 commit into
mainfrom
codex/fix-e2e-recovery-regressions

Conversation

@sandl99

@sandl99 sandl99 commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Recover three current-lifecycle E2E regressions from run 30283434843. Recreated sandboxes now tolerate the exact transient OpenShell Error phase, 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

  • Retry only the exact same-sandbox phase: Error readiness response inside the existing recreated-sandbox health guard and timeout; foreign sandboxes and other phases remain terminal.
  • Clear the E2E staging fixture's inherited EXIT trap after successful upstream or NemoClaw service staging, while preserving rollback on staging failures.
  • Keep the release EXDEV baseline pinned to its historical sandbox image and let the current-lifecycle target use the current CLI's validated base-image resolution.
  • Add focused regressions for each behavior.

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:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification: Internal recovery behavior and E2E fixture coverage changed without changing a user-facing command, configuration, output, or supported workflow.
  • 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: PASS with no findings; exact same-sandbox matching remains behind existing health and timeout guards.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: no-docs-needed
  • Evidence: Reviewed all seven committed files; the changes are internal recovery behavior and E2E fixtures/tests with no user-facing documentation contract change. git diff --check origin/main...HEAD passed.
  • Agent: Codex documentation-writer subagent

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 check:diff passed 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/sandbox/process-recovery.test.ts (41 passed); focused E2E-support tests (7 passed); full e2e-support project (1,744 passed, 17 skipped).
  • 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: San Dang sdang@nvidia.com

Summary by CodeRabbit

  • Bug Fixes

    • Improved sandbox recovery when OpenShell reports a temporary error state, allowing readiness checks to retry until the sandbox becomes available.
    • Prevented unrelated sandbox errors and failed states from being retried incorrectly.
    • Preserved installer cleanup sentinel files during gateway service staging.
  • Tests

    • Expanded coverage for sandbox recovery, lifecycle behavior, and runtime base-image selection.
    • Added validation for release-baseline and current-lifecycle deployment scenarios.

Signed-off-by: San Dang <sdang@nvidia.com>
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The 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.

Changes

Sandbox recovery

Layer / File(s) Summary
Transient OpenShell retry classification
src/lib/actions/sandbox/process-recovery.ts, src/lib/actions/sandbox/process-recovery.test.ts
Readiness probing retries a matching same-sandbox Error phase, while unrelated sandbox and Failed responses remain non-retryable; tests cover both paths.

OpenClaw plugin runtime EXDEV

Layer / File(s) Summary
Base-image selector contract and validation
test/e2e/live/openclaw-plugin-runtime-exdev-env.ts, test/e2e/support/openclaw-plugin-runtime-exdev-env.test.ts
Adds shared selectors and environment construction for release-baseline overrides and current-lifecycle defaults, with unit coverage.
Selector-based deployment wiring
test/e2e/live/openclaw-plugin-runtime-exdev.test.ts
Passes selectors through deployment setup, updates the release Dockerfile and contracts, and records current-CLI base-image resolution.

Lifecycle staging behavior

Layer / File(s) Summary
Staging trap and cleanup coverage
test/e2e/fixtures/phases/lifecycle.ts, test/e2e/support/lifecycle-user-service.test.ts
Clears EXIT traps in generated staging scripts and verifies the installer staging sentinel remains after execution.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested labels: area: e2e, bug-fix, v0.0.96

Suggested reviewers: cv, ericksoa, prekshivyas

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing current-lifecycle E2E regressions.
✨ Finishing Touches
📝 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-e2e-recovery-regressions

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

@sandl99

sandl99 commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator Author

Security review verdict

PASS — 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.

Findings

No findings.

Detailed analysis

  1. Secrets and credentials — PASS. No credentials, tokens, key material, or credential files were added. Existing dummy E2E credentials are unchanged.
  2. Input validation and data sanitization — PASS. The new retry path compares normalized stderr against an exact message containing the requested sandbox name. It does not interpolate that value into a command or parser.
  3. Authentication and authorization — PASS. No authentication or authorization behavior changes.
  4. Dependencies and third-party libraries — PASS. No dependency or lockfile changes.
  5. Error handling and logging — PASS. The retry remains bounded by existing health and timeout controls; unrelated errors remain terminal. No additional output or sensitive values are logged.
  6. Cryptography and data protection — PASS. No cryptographic or data-protection behavior changes.
  7. Configuration and security headers — PASS. No production security configuration, policy, port, privilege, image digest, or header changes. The E2E release image remains explicitly pinned; the current target delegates to the existing CLI compatibility validation.
  8. Security testing — PASS. Tests cover the allowed exact same-sandbox phase: Error response and deny a foreign sandbox and a different phase. Fixture tests preserve cleanup on failure and prevent inherited installer cleanup after success.
  9. System security — PASS. The change does not bypass the managed-health guard, extend the existing recovery deadline, mutate external state directly, or add an unbounded retry. The successful fixture path only clears its own inherited process-level EXIT trap after staging completes.

Files reviewed

  • src/lib/actions/sandbox/process-recovery.ts
  • src/lib/actions/sandbox/process-recovery.test.ts
  • test/e2e/fixtures/phases/lifecycle.ts
  • test/e2e/support/lifecycle-user-service.test.ts
  • test/e2e/live/openclaw-plugin-runtime-exdev-env.ts
  • test/e2e/live/openclaw-plugin-runtime-exdev.test.ts
  • test/e2e/support/openclaw-plugin-runtime-exdev-env.test.ts

Reviewed head: 497ca2dcbabb550aa246b1941797f00b58a19724

@github-code-quality

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 497ca2d in the codex/fix-e2e-recove... branch remains at 96%, unchanged from commit d0a95dc in the main branch.

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings reported

Advisor assessment: No blocking advisor findings reported
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings match; normalized E2E selections differ; severity counts match.

Nemotron output stays in workflow artifacts and does not change the assessment above.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: cloud-onboard, credential-sanitization, security-posture, onboard-repair, onboard-resume, openclaw-plugin-runtime-exdev, openclaw-plugin-runtime-exdev-release

1 optional E2E recommendation
  • ubuntu-repo-docker-post-reboot-recovery

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

@sandl99
sandl99 requested a review from cv July 27, 2026 18:05
@sandl99 sandl99 added area: e2e End-to-end tests, nightly failures, or validation infrastructure v0.0.96 labels Jul 27, 2026
@cv
cv merged commit d61bb07 into main Jul 27, 2026
93 of 101 checks passed
@cv
cv deleted the codex/fix-e2e-recovery-regressions branch July 27, 2026 18:05
apurvvkumaria pushed a commit that referenced this pull request Jul 28, 2026
<!-- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: e2e End-to-end tests, nightly failures, or validation infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants