Repository navigation
fix(rebuild): preserve legacy OpenClaw restores - #6534
Conversation
|
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR updates OpenClaw restore reconciliation inputs, adds recreated sandbox restore coverage, and tightens two live e2e assertions for host reachability and rebuild output. ChangesRecreated sandbox restore and e2e validation
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 |
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) — Changes requestedMerge posture: Do not merge yet Action checklist
Findings index
Review findings by urgency: 0 required fixes, 3 items to resolve/justify, 0 in-scope improvements
|
|
Advisor follow-up for
The new tests therefore stay scoped to the changed selection behavior: missing legacy provenance, authoritative known-empty provenance, and populated previous-to-fresh reconciliation. The existing managed-extension integration file passed locally (6/6), and the targeted live rebuild/upgrade jobs are running in E2E run 28990651976. |
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. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/lib/state/sandbox-recreated-openclaw-restore.test.ts (1)
99-155: 🎯 Functional Correctness | 🔵 Trivial | ⚖️ Poor tradeoffMock's cleanup simulation doesn't exercise the real exclusion list — only the
toContainassertions verify it.The stub
ssh's rm handler (Line 130-136) preserves entries from its ownfreshExtensionDirsclosure, not by parsingcmd. That meansstaleUserExtensionExists/freshMarkers(Lines 202-203, 233-236) pass regardless of whetherbuildRestoreCleanupCommandactually emitted the right-nameexclusions — the Line 243-244cleanupCommand.toContain(...)checks are the only assertions tying the test to the real command-building logic, and they lock in on literal command text rather than observable behavior. As per path instructions, "Flag ... broad mocks that bypass the behavior under test, and conditionals that make a test pass without exercising its claim." Consider having the mock parse the exclusion names fromcmd(or actually shell out tofind) so the filesystem assertions genuinely depend on the production-generated command.Also applies to: 243-244
🤖 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 `@src/lib/state/sandbox-recreated-openclaw-restore.test.ts` around lines 99 - 155, The cleanup test is still passing through a stubbed rm branch that preserves entries from a hardcoded freshExtensionDirs list instead of validating the command built by buildRestoreCleanupCommand. Update the mock ssh handler to derive the exclusion set from the actual cmd (or execute a real find-based cleanup) so staleUserExtensionExists and freshMarkers only pass when the generated -name exclusions are correct. Keep the focus on the ssh stub, buildRestoreCleanupCommand, and the filesystem assertions in this test.Source: Path instructions
🤖 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 `@src/lib/state/sandbox-recreated-openclaw-restore.test.ts`:
- Around line 99-155: The cleanup test is still passing through a stubbed rm
branch that preserves entries from a hardcoded freshExtensionDirs list instead
of validating the command built by buildRestoreCleanupCommand. Update the mock
ssh handler to derive the exclusion set from the actual cmd (or execute a real
find-based cleanup) so staleUserExtensionExists and freshMarkers only pass when
the generated -name exclusions are correct. Keep the focus on the ssh stub,
buildRestoreCleanupCommand, and the filesystem assertions in this test.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 13cd1ff2-e1aa-463c-a936-1da229e89ad3
📒 Files selected for processing (4)
src/lib/state/sandbox-recreated-openclaw-restore.test.tssrc/lib/state/sandbox.tstest/e2e/live/device-auth-health.test.tstest/e2e/live/rebuild-openclaw.test.ts
<!-- markdownlint-disable MD041 --> ## Summary This follow-up keeps the v0.0.78 release notes synchronized with PR #6495, which merged after the original release-prep docs refresh. The deeper network-policy reference already documents the exact endpoint, methods, and managed binaries. ## Changes - #6495 -> `docs/about/release-notes.mdx`: Add policy-routed repository reads to the v0.0.78 lead and explain that managed Deep Agents Code `fetch_url` uses NemoClaw's policy proxy with read-only `raw.githubusercontent.com` access. - Reviewed #6534 against the existing backup/restore and lifecycle documentation; no additional prose is needed because it restores the documented contract. ## 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; no code sample or generated behavior changed. - [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 — tests are not applicable to prose-only release notes - [ ] 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) — completed with 0 errors and 2 pre-existing Fern warnings - [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) --- <!-- 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: Charan Jagwani <cjagwani@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Updated release notes to reflect new opt-in thread-scoped auto-approval and policy-routed repository reads. * Added notes about sandboxed `fetch_url` handling for GitHub source access and the allowed GitHub request types. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- markdownlint-disable MD041 --> ## Summary This PR fixes the two deterministic failure families that blocked the v0.0.78 release candidate. It restores legacy and stock OpenClaw backups without weakening authoritative custom-image provenance checks, makes the device-auth fixture reachable from inside OpenShell sandboxes, and prevents incomplete rebuilds from appearing green in E2E. ## Changes - Preserve fresh image-managed extension directories while passing plugin provenance to the `openclaw.json` merge only when the backup contains the corresponding previous baseline. - Cover missing, known-empty, and populated previous-provenance restore paths, including stale image-owned configuration removal and fresh/user-owned state preservation. - Bind the device-auth fake inference service to the runner host bridge and advertise `host.openshell.internal` to the sandbox. - Require the rebuild E2E to observe the explicit success message and reject incomplete post-restore completion. ## 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 <!-- Check exactly one tests line and one docs line. Check other lines when applicable. Add every requested justification or approval reference. --> - [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 runtime fix restores the documented backup/restore contract without changing commands, configuration, defaults, migrations, or operator actions; the remaining changes are test-only. - [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: focused correctness review confirmed that missing legacy provenance takes the compatibility path, authoritative empty and populated provenance still reconcile, marked custom-image manifests remain fail-closed, and the random-port fake server follows the existing OpenShell host-bridge test pattern. - [ ] 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: - `npx vitest run --project cli src/lib/state/sandbox-recreated-openclaw-restore.test.ts src/lib/state/openclaw-config-restore-input.test.ts src/lib/state/openclaw-config-merge.test.ts src/lib/state/openclaw-plugin-restore.test.ts` (68 passed) - `npx vitest run --project integration test/snapshot-openclaw-managed-extensions.test.ts --reporter=verbose` (6 passed) - `npx vitest run --project e2e-support test/e2e/support/device-auth-health-helpers.test.ts test/e2e/support/rebuild-openclaw-old-base-context.test.ts` (7 passed) - `npm run typecheck:cli` and `npm run test:projects:check` passed - [ ] 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) - [ ] 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) --- <!-- 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: Charan Jagwani <cjagwani@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved sandbox restore behavior so recreated OpenClaw environments recover configuration and extension state more reliably. * Fixed restore handling to avoid carrying over stale extensions and to better preserve expected plugin installs. * Improved sandbox connectivity for health checks in live environments. * Rebuild flow now reports successful completion more clearly and avoids misleading incomplete-step messages. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- markdownlint-disable MD041 --> ## Summary This follow-up keeps the v0.0.78 release notes synchronized with PR NVIDIA#6495, which merged after the original release-prep docs refresh. The deeper network-policy reference already documents the exact endpoint, methods, and managed binaries. ## Changes - NVIDIA#6495 -> `docs/about/release-notes.mdx`: Add policy-routed repository reads to the v0.0.78 lead and explain that managed Deep Agents Code `fetch_url` uses NemoClaw's policy proxy with read-only `raw.githubusercontent.com` access. - Reviewed NVIDIA#6534 against the existing backup/restore and lifecycle documentation; no additional prose is needed because it restores the documented contract. ## 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; no code sample or generated behavior changed. - [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 — tests are not applicable to prose-only release notes - [ ] 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) — completed with 0 errors and 2 pre-existing Fern warnings - [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) --- <!-- 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: Charan Jagwani <cjagwani@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Updated release notes to reflect new opt-in thread-scoped auto-approval and policy-routed repository reads. * Added notes about sandboxed `fetch_url` handling for GitHub source access and the allowed GitHub request types. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
This PR fixes the two deterministic failure families that blocked the v0.0.78 release candidate. It restores legacy and stock OpenClaw backups without weakening authoritative custom-image provenance checks, makes the device-auth fixture reachable from inside OpenShell sandboxes, and prevents incomplete rebuilds from appearing green in E2E.
Changes
openclaw.jsonmerge only when the backup contains the corresponding previous baseline.host.openshell.internalto the sandbox.Type of Change
Quality Gates
Verification
Verifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run check:diffpassed when hooks were skipped or unavailablenpx vitest run --project cli src/lib/state/sandbox-recreated-openclaw-restore.test.ts src/lib/state/openclaw-config-restore-input.test.ts src/lib/state/openclaw-config-merge.test.ts src/lib/state/openclaw-plugin-restore.test.ts(68 passed)npx vitest run --project integration test/snapshot-openclaw-managed-extensions.test.ts --reporter=verbose(6 passed)npx vitest run --project e2e-support test/e2e/support/device-auth-health-helpers.test.ts test/e2e/support/rebuild-openclaw-old-base-context.test.ts(7 passed)npm run typecheck:cliandnpm run test:projects:checkpassednpm 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: Charan Jagwani cjagwani@nvidia.com
Summary by CodeRabbit
Bug Fixes
openclaw.jsonconfiguration and extension/plugin state from rebuild artifacts.Tests