Skip to content

fix(onboard): allow downstream resume states - #5690

Merged
cv merged 4 commits into
mainfrom
hotfix/onboard-resume-compat-advisor
Jun 23, 2026
Merged

fix(onboard): allow downstream resume states#5690
cv merged 4 commits into
mainfrom
hotfix/onboard-resume-compat-advisor

Conversation

@jyaunches

@jyaunches jyaunches commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix resume compatibility after PR refactor(onboard): declare resume compatibility states #5642 by allowing earlier onboard slices to pass through downstream persisted machine states such as policies.
  • Add regression coverage for resume-from-policies through initial/core slice compatibility.
  • Harden the E2E advisor prompts so onboarding machine/resume changes require the correct resume/repair E2E coverage in the future.

Root cause

PR #5642 made runLiveOnboardFlowSlice validate declared compatibility states during resume. onboard.ts still invokes initial and core slices before final onboarding, so a saved resume session already at policies failed in the initial slice before final resume/repair handling could run.

Observed nightly failures in run 28050018215:

  • onboard-resume-e2e: UnexpectedLiveOnboardFlowSliceStateError: ... policies
  • onboard-repair-e2e: UnexpectedLiveOnboardFlowSliceStateError: ... policies

Validation

Passed targeted local tests:

npm test -- src/lib/onboard/machine/initial-flow-phases.test.ts src/lib/onboard/machine/core-flow-phases.test.ts src/lib/onboard/machine/live-flow-slice.test.ts test/e2e-advisor.test.ts test/e2e-scenario-advisor.test.ts

Note: a broad local pre-commit test run hit unrelated local fixture/environment failures (nemoclaw/node_modules/json5, missing nemoclaw/dist/blueprint/private-networks.js, local timeouts); the targeted tests above passed.

E2E follow-up

After opening this PR I will dispatch:

  • nightly-e2e.yaml with jobs=onboard-resume-e2e,onboard-repair-e2e
  • e2e-vitest-scenarios.yaml with jobs=onboard-resume-vitest,onboard-repair-vitest

Summary by CodeRabbit

Release Notes

  • Improvements

    • Expanded onboarding resume compatibility to tolerate additional advanced flow stages, improving recovery for interrupted sessions.
    • Strengthened onboarding advisor system-prompt rules to explicitly require the correct resume and repair compatibility identifiers for relevant onboarding changes.
  • Tests

    • Expanded parameterized onboarding resume test coverage across multiple saved machine states, including explicit rejection for terminal saved states.
    • Added/extended e2e tests to verify the advisor prompts include the expected onboarding resume and repair rule identifiers.

@github-code-quality

github-code-quality Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the hotfix/onboard-resum... branch is 96%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main hotfix/onboard-resum... adbf8a6 +/-
nemoclaw/src/se...cret-scanner.ts 100%
nemoclaw/src/commands/slash.ts 100%
nemoclaw/src/li...bprocess-env.ts 100%
nemoclaw/src/bl...eprint/state.ts 98%
nemoclaw/src/onboard/config.ts 98%
nemoclaw/src/bl...int/snapshot.ts 97%
nemoclaw/src/bl...print/runner.ts 95%
nemoclaw/src/co...ration-state.ts 94%
nemoclaw/src/bl...ate-networks.ts 94%
nemoclaw/src/index.ts 94%

TypeScript / code-coverage/cli

The overall coverage in the hotfix/onboard-resum... branch is 46%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main hotfix/onboard-resum... adbf8a6 +/-
src/lib/state/o...oard-session.ts 91%
src/lib/inference/local.ts 76%
src/lib/sandbox/config.ts 72%
src/lib/actions...dbox/rebuild.ts 67%
src/lib/onboard/preflight.ts 64%
src/lib/actions...licy-channel.ts 56%
src/lib/state/sandbox.ts 55%
src/lib/onboard...er-gpu-patch.ts 50%
src/lib/policy/index.ts 49%
src/lib/onboard.ts 18%

Updated June 23, 2026 21:29 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: onboard-resume-e2e, onboard-repair-e2e
Optional E2E: cloud-onboard-e2e, onboard-negative-paths-e2e

Dispatch hint: onboard-resume-e2e,onboard-repair-e2e

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • onboard-resume-e2e: Required because the runtime changes are in src/lib/onboard/machine live slice resume compatibility handling. This job exercises interrupted onboarding followed by --resume against a real sandbox/session and can catch regressions in persisted downstream state compatibility.
  • onboard-repair-e2e: Required because the expanded compatibility states are intended to allow resume repair/backstop checks to re-run before later phases. This job validates real onboard repair behavior from persisted sessions and damaged or stale sandbox state.

Optional E2E

  • cloud-onboard-e2e: Optional confidence check for the standard hosted onboarding path because the changed files are central onboarding slice orchestration used by real cloud onboarding, though the behavioral delta is specifically resume/repair compatibility rather than fresh hosted onboarding.
  • onboard-negative-paths-e2e: Optional adjacent coverage for onboarding failure/invalid-state behavior because this PR adds terminal complete/failed session rejection in compatibility paths. Unit tests cover this directly, so it is not merge-blocking.

New E2E recommendations

  • None.

Dispatch hint

  • Workflow: nightly-e2e.yaml
  • jobs input: onboard-resume-e2e,onboard-repair-e2e

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

Required Vitest E2E scenarios: onboard-resume-vitest, onboard-repair-vitest
Optional Vitest E2E scenarios: None

Dispatch required Vitest E2E scenarios:

  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=onboard-resume-vitest
  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=onboard-repair-vitest

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required Vitest E2E scenarios

  • onboard-resume-vitest: Changes expand onboarding live slice resume compatibility states in src/lib/onboard/machine. The wired onboard-resume Vitest job directly exercises interrupted onboarding followed by --resume, including persisted-session compatibility paths.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=onboard-resume-vitest
  • onboard-repair-vitest: The same initial/core slice compatibility change can affect repair/backstop execution from persisted sessions. The onboard-repair Vitest job is the focused live coverage for repairing existing onboarding state and must remain required for this state-machine path.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=onboard-repair-vitest

Optional Vitest E2E scenarios

  • None.

Relevant changed files

  • src/lib/onboard/machine/core-flow-phases.ts
  • src/lib/onboard/machine/initial-flow-phases.ts
  • src/lib/onboard/machine/core-flow-phases.test.ts
  • src/lib/onboard/machine/initial-flow-phases.test.ts
  • tools/e2e-advisor/scenarios.mts
  • test/e2e-scenario-advisor.test.ts

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings

Merge posture: No blocking advisor findings
Primary next action: Add or justify PRA-T1 and any related test follow-ups.
Open items: 0 required · 0 warnings · 0 suggestions · 2 test follow-ups
Since last review: 2 prior items resolved · 0 still apply · 0 new items found

Action checklist

  • PRA-T1 Add or justify test follow-up: Runtime validation
  • PRA-T2 Add or justify test follow-up: Runtime validation
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

  • PRA-T1 Runtime validation — Add or identify a runtime-boundary test where `runInitialOnboardFlowSlice` and `runCoreOnboardFlowSlice` use a real `OnboardRuntimeBoundary.recordStateResultWithStepCompatibility` from a persisted `finalizing` or `post_verify` session, proving stale phase transitions are skipped without applying context updates.. The changed wrapper tests are focused and cover the allowlist and terminal negative paths. Because these live-slice compatibility paths protect onboarding resume/repair sequencing around sandbox lifecycle backstops and `OnboardRuntimeBoundary`, one runtime-boundary or integration-level regression would further reduce risk without relying on external E2E status.
  • PRA-T2 Runtime validation — Add or identify an integration/runtime-sequence test where resume from a persisted `finalizing` session still runs initial preflight/gateway and core provider/sandbox repair backstops before final policy or final verification handling observes the session.. The changed wrapper tests are focused and cover the allowlist and terminal negative paths. Because these live-slice compatibility paths protect onboarding resume/repair sequencing around sandbox lifecycle backstops and `OnboardRuntimeBoundary`, one runtime-boundary or integration-level regression would further reduce risk without relying on external E2E status.

Workflow run details

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.

@github-actions

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Results — ✅ All requested jobs passed

Run: 28052805978
Workflow ref: hotfix/onboard-resume-compat-advisor
Requested scenarios: (default — all supported)
Requested jobs: onboard-resume-vitest,onboard-repair-vitest
Summary: 2 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
onboard-repair-vitest ✅ success
onboard-resume-vitest ✅ success

@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 28052794085
Target ref: hotfix/onboard-resume-compat-advisor
Requested jobs: onboard-resume-e2e,onboard-repair-e2e
Summary: 2 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
onboard-repair-e2e ✅ success
onboard-resume-e2e ✅ success

@coderabbitai

coderabbitai Bot commented Jun 23, 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: 7461280c-b47d-4f6c-be95-4680bb6229c5

📥 Commits

Reviewing files that changed from the base of the PR and between d16c7fa and adbf8a6.

📒 Files selected for processing (2)
  • src/lib/onboard/machine/core-flow-phases.ts
  • src/lib/onboard/machine/initial-flow-phases.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/lib/onboard/machine/core-flow-phases.ts
  • src/lib/onboard/machine/initial-flow-phases.ts

📝 Walkthrough

Walkthrough

compatibilityWhenState arrays in runInitialOnboardFlowSlice and runCoreOnboardFlowSlice are expanded to cover additional onboarding phases. Matching tests validate resume behavior and terminal-state rejection. buildSystemPrompt is exported from the e2e-advisor, and both advisor prompt builders gain new onboarding resume/repair decision-policy rules; advisor tests verify their presence.

Changes

Onboarding Resume Compatibility Expansion

Layer / File(s) Summary
Expand compatibilityWhenState and update documentation in initial and core flow slices
src/lib/onboard/machine/initial-flow-phases.ts, src/lib/onboard/machine/core-flow-phases.ts
runInitialOnboardFlowSlice expands compatibilityWhenState to include inference, sandbox, openclaw, agent_setup, policies, finalizing, and post_verify. runCoreOnboardFlowSlice adds policies, finalizing, and post_verify. Inline documentation for both functions is updated to describe the compatibility-bridge behavior.
Tests for resume and terminal-state rejection
src/lib/onboard/machine/initial-flow-phases.test.ts, src/lib/onboard/machine/core-flow-phases.test.ts
Parameterized tests verify resuming at machine state "policies" proceeds through expected downstream phases; rejection tests assert that terminal states ("complete", "failed") are rejected with "Unexpected onboarding live flow state before slice entry" before any phase execution.

E2E Advisor Onboarding Resume Rules

Layer / File(s) Summary
Export buildSystemPrompt and add onboarding resume rules to advisor prompts
tools/e2e-advisor/analyze.mts, tools/e2e-advisor/scenarios.mts
buildSystemPrompt() is changed to an exported function; its decision-policy text gains a rule requiring onboard-resume-e2e + onboard-repair-e2e (and optionally cloud-onboard-e2e) for onboarding state-machine changes; scenarios.mts adds a rule requiring onboard-resume-vitest and onboard-repair-vitest for persisted-session repair paths.
Advisor prompt tests assert new onboarding rules
test/e2e-advisor.test.ts, test/e2e-scenario-advisor.test.ts
New e2e-advisor.test.ts calls the exported buildSystemPrompt() and asserts it contains onboarding resume/repair rule text and src/lib/onboard/machine reference; e2e-scenario-advisor.test.ts adds assertions for onboard-resume-vitest and onboard-repair-vitest.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#5642: Modifies the same compatibilityWhenState handling in runCoreOnboardFlowSlice and runInitialOnboardFlowSlice and their resume-related tests, directly preceding this expansion.

Suggested reviewers

  • cv

Poem

🐇 Hippity-hop through each onboarding phase,
policies, finalizing — now covered always!
The resume path widens, no state left behind,
The advisor writes rules so no test slips the mind.
From sandbox to openclaw, the transitions stay true —
A rabbit ensures every phase passes through! ✨

🚥 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%. 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: expanding downstream resume states allowed by onboarding slices to fix a compatibility issue.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 hotfix/onboard-resume-compat-advisor

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

@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ❌ Some jobs failed

Run: 28056430140
Target ref: hotfix/onboard-resume-compat-advisor
Requested jobs: onboard-resume-e2e,onboard-repair-e2e,rebuild-hermes-e2e,rebuild-hermes-stale-base-e2e,upgrade-stale-sandbox-e2e,hermes-discord-e2e,channels-add-remove-e2e,messaging-providers-e2e,channels-stop-start-hermes-e2e,channels-stop-start-openclaw-e2e,double-onboard-e2e,openclaw-tui-chat-correlation-e2e
Summary: 1 passed, 11 failed, 0 cancelled, 0 skipped

Job Result
channels-add-remove-e2e ❌ failure
channels-stop-start-hermes-e2e ❌ failure
channels-stop-start-openclaw-e2e ❌ failure
double-onboard-e2e ✅ success
hermes-discord-e2e ❌ failure
messaging-providers-e2e ❌ failure
onboard-repair-e2e ❌ failure
onboard-resume-e2e ❌ failure
openclaw-tui-chat-correlation-e2e ❌ failure
rebuild-hermes-e2e ❌ failure
rebuild-hermes-stale-base-e2e ❌ failure
upgrade-stale-sandbox-e2e ❌ failure

Failed jobs: channels-add-remove-e2e, channels-stop-start-hermes-e2e, channels-stop-start-openclaw-e2e, hermes-discord-e2e, messaging-providers-e2e, onboard-repair-e2e, onboard-resume-e2e, openclaw-tui-chat-correlation-e2e, rebuild-hermes-e2e, rebuild-hermes-stale-base-e2e, upgrade-stale-sandbox-e2e. Check run artifacts for logs.

@cv cv added the v0.0.67 label Jun 23, 2026
@cv

cv commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

PR Review Advisor follow-up:

  • PRA-T1 / PRA-T2: this PR now has wrapper-level coverage for every newly admitted downstream non-terminal state in runInitialOnboardFlowSlice and runCoreOnboardFlowSlice, plus terminal complete/failed rejection before phase side effects. That directly covers the changed allowlist behavior. The broader real-runtime sequence is covered by the existing live slice/FSM runtime tests and CI e2e gates; adding another runtime-boundary harness here would duplicate those paths for a hotfix whose production change is the static compatibility allowlist and explanatory source-of-truth comments.

@cv
cv merged commit 46ead83 into main Jun 23, 2026
45 checks passed
@cv
cv deleted the hotfix/onboard-resume-compat-advisor branch June 23, 2026 21:30
@wscurran wscurran added area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow bug-fix PR fixes a bug or regression labels Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants