Skip to content

refactor(onboard): consume handler FSM results compatibly#4454

Merged
cv merged 26 commits into
mainfrom
stack/onboard-fsm-consume-results-compat
Jun 5, 2026
Merged

refactor(onboard): consume handler FSM results compatibly#4454
cv merged 26 commits into
mainfrom
stack/onboard-fsm-consume-results-compat

Conversation

@cv

@cv cv commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Start consuming returned handler FSM results in the live onboarding sequence through a compatibility bridge. The bridge applies results when the runtime still needs the transition and treats already-advanced legacy step-helper state as a no-op.

Changes

  • Add recordStateResultWithStepCompatibility() to the runtime boundary.
  • Call the compatibility bridge after preflight, gateway, provider/inference, sandbox, agent setup, and policies handlers.
  • Add tests for applying compatible results, no-op behavior after legacy advancement, and stale result handling when tests leave the machine behind.

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)

Verification

  • npx prek run --all-files passes
  • npm test passes
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • 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: Carlos Villela cvillela@nvidia.com

Summary by CodeRabbit

  • New Features

    • Added state machine runner for onboarding with transition limits and error handling.
    • Introduced new "result skipped" event type for state transition diagnostics.
    • Enhanced runtime boundary with step-compatibility aware state result recording.
  • Tests

    • Added comprehensive test coverage for state machine runner and runtime boundary compatibility.

cv added 16 commits May 27, 2026 15:18
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv cv self-assigned this May 28, 2026
@copy-pr-bot

copy-pr-bot Bot commented May 28, 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 May 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@cv, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 91 minutes. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a3a7898a-865c-4905-ba8e-50ad6ca958dd

📥 Commits

Reviewing files that changed from the base of the PR and between c5d3d1c and 9372e41.

📒 Files selected for processing (5)
  • src/lib/onboard.ts
  • src/lib/onboard/machine/runner.test.ts
  • src/lib/onboard/machine/runner.ts
  • src/lib/onboard/runtime-boundary.test.ts
  • src/lib/onboard/runtime-boundary.ts
📝 Walkthrough

Walkthrough

Introduces a state machine runner that executes onboarding transitions through non-terminal states with handler dispatch and transition limits, adds runtime-boundary-level compatibility logic to coexist with legacy step helpers, extends event vocabulary for skip events, and integrates compatibility-aware result recording into the main onboarding orchestration.

Changes

Onboarding state machine runner and compatibility bridge

Layer / File(s) Summary
Machine runner infrastructure
src/lib/onboard/machine/runner.ts, src/lib/onboard/machine/runner.test.ts
runOnboardMachine implements state machine execution by fetching the current session, dispatching handlers for non-terminal states, applying results via runtime, and enforcing a configurable transition limit (default 100). Error classes handle missing handlers and limit exhaustion. Tests verify successful multi-state flows with context accumulation, failure handling, terminal state shortcuts, error rejection, and transition limits.
Event type extension and vocabulary update
src/lib/onboard/machine/types.ts, src/lib/onboard/machine/transitions.test.ts
Added "state.result.skipped" to ONBOARD_MACHINE_EVENT_TYPES, expanding the OnboardMachineEventType union and the test vocabulary to include this new event for diagnostic skip emissions.
Runtime-boundary compatibility bridge
src/lib/onboard/machine/runtime.ts, src/lib/onboard/runtime-boundary.ts, src/lib/onboard/runtime-boundary.test.ts
OnboardRuntime.emitResultSkipped() broadcasts skip events with metadata. OnboardRuntimeBoundary adds recordStateResultWithStepCompatibility and recordStateResultsWithStepCompatibility to detect when transition results conflict with already-advanced machine states (e.g., legacy step helpers moved the machine forward) and emit skip diagnostics instead of re-applying. Test harness gains state transition helpers and test suite validates skip emission, state mismatch detection, and sandbox/retry compatibility scenarios.
Onboarding orchestration integration
src/lib/onboard.ts
All major state handlers (preflight, gateway, provider inference with retries, sandbox, agent setup, policy setup) now record results via recordStateResultWithStepCompatibility(...) instead of direct session assignment, ensuring compatibility when legacy step helpers and FSM-style transitions coexist.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#4446: Updates preflight and gateway handlers to return explicit FSM transition objects that pair directly with this PR's compatibility-aware recording of those results.
  • NVIDIA/NemoClaw#4444: Makes handleAgentSetupState return explicit FSM transitions, complementing this PR's compatible recording at the agent-setup handler point.
  • NVIDIA/NemoClaw#4445: Updates handlePoliciesState to return explicit FSM transitions to finalizing, aligning with this PR's policy-setup handler recording changes.

Suggested labels

onboarding

Suggested reviewers

  • prekshivyas
  • cjagwani
  • ericksoa

🐰 A runner hops through states so fine,
Each transition marked by a clean design,
When old and new paths both take flight,
We skip and emit—just right!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% 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 accurately captures the main objective: introducing a compatibility bridge (recordStateResultWithStepCompatibility) to consume FSM handler results while maintaining backward compatibility with legacy step helpers.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch stack/onboard-fsm-consume-results-compat

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

@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: cloud-onboard-e2e, onboard-resume-e2e, hermes-e2e
Optional E2E: onboard-repair-e2e, ubuntu-repo-cloud-openclaw-double-provider-switch, double-onboard-e2e

Dispatch hint: cloud-onboard-e2e,onboard-resume-e2e,hermes-e2e

Auto-dispatched E2E: cloud-onboard-e2e, onboard-resume-e2e, hermes-e2e via nightly-e2e.yaml at 9372e41141628222f554ff24c21fc2dcd3f42fdbnightly run

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • cloud-onboard-e2e (high): Baseline full cloud onboarding is required because the main onboard flow now consumes every major state result through the new compatibility path and could regress sandbox creation, provider setup, policies, or final completion.
  • onboard-resume-e2e (high): Direct coverage for interrupted onboard followed by --resume; this PR specifically changes how stale/already-applied state transition results are skipped when legacy step helpers have advanced the session.
  • hermes-e2e (high): Required to exercise the non-OpenClaw agent_setup branch after sandbox creation; the changed compatibility logic has explicit branch behavior for agent setup sandboxes.

Optional E2E

  • onboard-repair-e2e (high): Useful adjacent confidence for resume repair and conflict behavior because the runtime boundary emits skip diagnostics and resume conflict events, but the direct merge-blocking risk is better covered by onboard-resume-e2e.
  • ubuntu-repo-cloud-openclaw-double-provider-switch (high): Useful scenario coverage for provider selection retryStateResults now consumed via recordStateResultsWithStepCompatibility, especially stale retry results followed by successful inference setup.
  • double-onboard-e2e (very high): Adjacent lifecycle confidence for repeated onboarding and gateway/sandbox reuse after state result recording changes, but less targeted than resume coverage.

New E2E recommendations

  • onboarding-state-machine-observability (medium): Existing resume E2E validates step statuses and completion, but does not appear to assert session.machine.state/revision or state.result.skipped event telemetry after legacy step/result compatibility skips.
    • Suggested test: Extend onboard-resume-e2e or add a focused E2E that inspects onboard-session machine state and emitted trace/events for already_at_target/source_state_mismatch compatibility skips.

Dispatch hint

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

@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

E2E Scenario Advisor Recommendation

Required scenario E2E: ubuntu-repo-cloud-openclaw, ubuntu-repo-cloud-hermes, ubuntu-repo-cloud-openclaw-resume, ubuntu-repo-cloud-openclaw-double-provider-switch
Optional scenario E2E: ubuntu-no-docker-preflight-negative, ubuntu-repo-cloud-openclaw-repair, wsl-repo-cloud-openclaw, gpu-repo-local-ollama-openclaw, macos-repo-cloud-openclaw

Dispatch required scenario E2E:

  • gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw
  • gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-hermes
  • gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw-resume
  • gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw-double-provider-switch

Workflow run

Full scenario advisor summary

E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required scenario E2E

  • ubuntu-repo-cloud-openclaw: Primary Ubuntu repo-current OpenClaw onboarding path. The PR changes core onboarding FSM/result recording and runtime-boundary compatibility used across preflight, gateway, provider/inference, sandbox, OpenClaw setup, policies, and finalization.
    • Dispatch: gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw
  • ubuntu-repo-cloud-hermes: Exercises the non-OpenClaw agent branch through agent_setup, which is directly relevant to the changed sandbox/agent state-result compatibility behavior.
    • Dispatch: gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-hermes
  • ubuntu-repo-cloud-openclaw-resume: Targets resume-after-interrupt onboarding, where stale/current FSM state compatibility and skipped state-result diagnostics are most likely to affect scenario behavior.
    • Dispatch: gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw-resume
  • ubuntu-repo-cloud-openclaw-double-provider-switch: Targets provider retry/switch lifecycle behavior, matching the PR's changes around recording retryStateResults and transition compatibility for provider/inference state results.
    • Dispatch: gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw-double-provider-switch

Optional scenario E2E

  • ubuntu-no-docker-preflight-negative: Optional negative coverage for preflight failure behavior, adjacent to the changed preflight state-result recording in src/lib/onboard.ts.
    • Dispatch: gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-no-docker-preflight-negative
  • ubuntu-repo-cloud-openclaw-repair: Optional lifecycle-adjacent coverage for repair-existing-config flows that also use onboarding runtime diagnostics and state recording.
    • Dispatch: gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw-repair
  • wsl-repo-cloud-openclaw: Optional special-runner platform coverage for the same OpenClaw onboarding state flow under WSL.
    • Dispatch: gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=wsl-repo-cloud-openclaw
  • gpu-repo-local-ollama-openclaw: Optional special-runner coverage for the local Ollama/GPU onboarding path; useful because core FSM/runtime-boundary changes are provider-agnostic, but the GPU runner is not the primary path.
    • Dispatch: gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=gpu-repo-local-ollama-openclaw
  • macos-repo-cloud-openclaw: Optional special-runner platform coverage for repo-current onboarding on macOS; Docker-dependent suites are skipped on GitHub-hosted macOS.
    • Dispatch: gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=macos-repo-cloud-openclaw

Relevant changed files

  • src/lib/onboard.ts
  • src/lib/onboard/machine/runner.ts
  • src/lib/onboard/machine/runtime.ts
  • src/lib/onboard/machine/types.ts
  • src/lib/onboard/runtime-boundary.ts

@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor

Findings: 2 needs attention, 2 worth checking, 0 nice ideas
Since last review: 0 prior items resolved, 2 still apply, 1 new item found

Review findings

🛠️ Needs attention

  • source_state_mismatch still skips transitions when the runtime is behind (src/lib/onboard/runtime-boundary.ts:134): The compatibility bridge skips any transition result whose metadata source state differs from the current machine state. That covers the documented legacy-step-helper case where the machine is already at or ahead of the result, but it also covers the opposite case where the runtime is behind the result source. In that case, the result may be evidence that the live sequence or legacy mutation missed a required transition, yet the bridge emits a skipped diagnostic and leaves the persisted machine state stale.
    • Recommendation: Only treat source mismatches as compatible no-ops when the current state is demonstrably already at the result target or otherwise known to be ahead due to legacy step-helper mutation. For behind or unknown mismatches, throw/fail loudly or add a separate, fully justified path with regression coverage proving why stale persisted state is safe.
    • Evidence: runtime-boundary.ts skips on `sourceState && current.machine.state !== sourceState`. runtime-boundary.test.ts:191-207 expects an initial `init` session receiving `advanceTo("gateway", { metadata: { state: "preflight" } })` to emit `state.result.skipped` and remain at `init`.
  • runtime-boundary.test.ts grew into a larger monolith (src/lib/onboard/runtime-boundary.test.ts:1): The changed runtime-boundary test file grew from 115 to 402 lines, a +287 line increase in a hot onboarding FSM surface. The added scenarios are valuable, but keeping all harness logic and compatibility cases in one file makes future FSM migration review harder.
    • Recommendation: Extract shared runtime harness helpers or split compatibility scenarios into focused test modules so the new coverage does not create a larger monolith hotspot.
    • Evidence: Deterministic monolith analysis reported `src/lib/onboard/runtime-boundary.test.ts` baseLines=115, headLines=402, delta=287, severity=blocker.

🔎 Worth checking

  • Source-of-truth review needed: src/lib/onboard/runtime-boundary.ts compatibility bridge for handler FSM results: The advisor marked localized patch analysis as needs_followup.
    • Recommendation: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
    • Evidence: The source-of-truth explanation is mostly present in `runtime-boundary.ts`, but the implementation and tests also treat a behind current state (`init`) with source `preflight` and target `gateway` as skippable. That case is broader than the documented legacy-advanced workaround.
  • Tolerant FSM result skipping weakens security confidence in onboarding phase ordering (src/lib/onboard/runtime-boundary.ts:134): No direct sandbox escape, SSRF bypass, credential leak, policy bypass, blueprint tampering, installer-trust issue, or workflow trusted-code-boundary regression was found. However, onboarding host glue is security-sensitive, and the broad source-mismatch skip can conceal ordering defects around sandbox, policy, and finalization phases.
    • Recommendation: Constrain the compatibility bridge to known legacy-advanced states and add behavioral validation that sandbox/policy/finalization state remains aligned when handler FSM results are consumed.
    • Evidence: The new compatibility path emits `state.result.skipped` instead of enforcing the transition when `current.machine.state !== sourceState`; this is also covered by the behind-state test in runtime-boundary.test.ts.

🌱 Nice ideas

  • None.
Consider writing more tests for
  • **Runtime validation** — Runtime boundary rejects or loudly reports a transition result when current machine state is behind the result metadata source state. Unit coverage is strong for bridge mechanics and runner transition-limit behavior, but the changed live `onboard.ts` host glue depends on interactions among handler-returned results, legacy step-helper session mutation, and persisted machine snapshots in security-sensitive onboarding phases.
  • **Runtime validation** — Live onboarding sequence keeps persisted `session.machine.state` aligned after each compatibility-consumed handler result. Unit coverage is strong for bridge mechanics and runner transition-limit behavior, but the changed live `onboard.ts` host glue depends on interactions among handler-returned results, legacy step-helper session mutation, and persisted machine snapshots in security-sensitive onboarding phases.
  • **Runtime validation** — Provider retry compatibility records retry diagnostics without preventing the final inference-to-sandbox transition in the live host-glue sequence. Unit coverage is strong for bridge mechanics and runner transition-limit behavior, but the changed live `onboard.ts` host glue depends on interactions among handler-returned results, legacy step-helper session mutation, and persisted machine snapshots in security-sensitive onboarding phases.
  • **Runtime validation** — Finalization completes from `post_verify` after `recordPostVerifyStarted()` when consumed through the compatibility alias. Unit coverage is strong for bridge mechanics and runner transition-limit behavior, but the changed live `onboard.ts` host glue depends on interactions among handler-returned results, legacy step-helper session mutation, and persisted machine snapshots in security-sensitive onboarding phases.
  • **Runtime validation** — Skipped compatibility results never apply provider, model, credential, sandbox, or policy context updates. Unit coverage is strong for bridge mechanics and runner transition-limit behavior, but the changed live `onboard.ts` host glue depends on interactions among handler-returned results, legacy step-helper session mutation, and persisted machine snapshots in security-sensitive onboarding phases.
  • **Acceptance clause:** `npx prek run --all-files` passes — add test evidence or identify existing coverage. Claim appears in the PR body, but this advisory review did not execute package-manager or test commands and does not report external CI status.
  • **Acceptance clause:** `npm test` passes — add test evidence or identify existing coverage. Claim appears in the PR body, but this advisory review did not execute package-manager or test commands and does not report external CI status.
  • **Acceptance clause:** Docs updated for user-facing behavior changes — add test evidence or identify existing coverage. No docs changed. The patch appears primarily internal to onboarding FSM/runtime diagnostics, though it does add a new machine event type.
Since last review details

Current findings:

  • Source-of-truth review needed: src/lib/onboard/runtime-boundary.ts compatibility bridge for handler FSM results: The advisor marked localized patch analysis as needs_followup.
    • Recommendation: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
    • Evidence: The source-of-truth explanation is mostly present in `runtime-boundary.ts`, but the implementation and tests also treat a behind current state (`init`) with source `preflight` and target `gateway` as skippable. That case is broader than the documented legacy-advanced workaround.
  • source_state_mismatch still skips transitions when the runtime is behind (src/lib/onboard/runtime-boundary.ts:134): The compatibility bridge skips any transition result whose metadata source state differs from the current machine state. That covers the documented legacy-step-helper case where the machine is already at or ahead of the result, but it also covers the opposite case where the runtime is behind the result source. In that case, the result may be evidence that the live sequence or legacy mutation missed a required transition, yet the bridge emits a skipped diagnostic and leaves the persisted machine state stale.
    • Recommendation: Only treat source mismatches as compatible no-ops when the current state is demonstrably already at the result target or otherwise known to be ahead due to legacy step-helper mutation. For behind or unknown mismatches, throw/fail loudly or add a separate, fully justified path with regression coverage proving why stale persisted state is safe.
    • Evidence: runtime-boundary.ts skips on `sourceState && current.machine.state !== sourceState`. runtime-boundary.test.ts:191-207 expects an initial `init` session receiving `advanceTo("gateway", { metadata: { state: "preflight" } })` to emit `state.result.skipped` and remain at `init`.
  • Tolerant FSM result skipping weakens security confidence in onboarding phase ordering (src/lib/onboard/runtime-boundary.ts:134): No direct sandbox escape, SSRF bypass, credential leak, policy bypass, blueprint tampering, installer-trust issue, or workflow trusted-code-boundary regression was found. However, onboarding host glue is security-sensitive, and the broad source-mismatch skip can conceal ordering defects around sandbox, policy, and finalization phases.
    • Recommendation: Constrain the compatibility bridge to known legacy-advanced states and add behavioral validation that sandbox/policy/finalization state remains aligned when handler FSM results are consumed.
    • Evidence: The new compatibility path emits `state.result.skipped` instead of enforcing the transition when `current.machine.state !== sourceState`; this is also covered by the behind-state test in runtime-boundary.test.ts.
  • runtime-boundary.test.ts grew into a larger monolith (src/lib/onboard/runtime-boundary.test.ts:1): The changed runtime-boundary test file grew from 115 to 402 lines, a +287 line increase in a hot onboarding FSM surface. The added scenarios are valuable, but keeping all harness logic and compatibility cases in one file makes future FSM migration review harder.
    • Recommendation: Extract shared runtime harness helpers or split compatibility scenarios into focused test modules so the new coverage does not create a larger monolith hotspot.
    • Evidence: Deterministic monolith analysis reported `src/lib/onboard/runtime-boundary.test.ts` baseLines=115, headLines=402, delta=287, severity=blocker.

Workflow run details

This is an automated advisory review. A human maintainer must make the final merge decision.

@wscurran wscurran added enhancement: testing refactor PR restructures code without intended behavior change labels May 28, 2026
@cv cv added the onboarding label May 29, 2026
@wscurran wscurran added area: e2e End-to-end tests, nightly failures, or validation infrastructure area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow feature PR adds or expands user-visible functionality and removed enhancement: testing labels Jun 3, 2026
cv added 4 commits June 4, 2026 14:05
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv cv marked this pull request as ready for review June 4, 2026 21:06
cv added 2 commits June 4, 2026 14:10
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Comment thread src/lib/onboard.ts Fixed
Comment thread src/lib/onboard.ts Fixed
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 26979949639
Target ref: cc637fd3297772c992704afec14d92492971faf9
Workflow ref: stack/onboard-fsm-runner
Requested jobs: cloud-e2e,onboard-resume-e2e,onboard-repair-e2e
Summary: 0 passed, 0 failed, 0 skipped

Job Result
cloud-e2e ⚠️ cancelled
onboard-repair-e2e ⚠️ cancelled
onboard-resume-e2e ⚠️ cancelled

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 26980075595
Target ref: a373ddd515e1ba77731a86176205d5050c534268
Workflow ref: stack/onboard-fsm-runner
Requested jobs: onboard-resume-e2e,cloud-onboard-e2e
Summary: 2 passed, 0 failed, 0 skipped

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

Base automatically changed from stack/onboard-fsm-runner to main June 4, 2026 21:25
@cv cv added the v0.0.60 Release target label Jun 4, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

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

Inline comments:
In `@src/lib/onboard/machine/runner.ts`:
- Around line 66-69: normalizeMaxTransitions currently passes NaN/Infinity
through Math.trunc which yields NaN and bypasses transition limits; update
normalizeMaxTransitions to treat non-finite values as absent by checking
Number.isFinite(value) (or isFinite) and returning DEFAULT_MAX_TRANSITIONS when
the check fails, otherwise return Math.max(1, Math.trunc(value)); reference
normalizeMaxTransitions and DEFAULT_MAX_TRANSITIONS when making the change.

In `@src/lib/onboard/runtime-boundary.ts`:
- Around line 10-15: The current assertSkippableTransitionResult rejects any
non-empty updates object even if all values are undefined; change the guard so
it treats only materialized updates as non-skippable by checking for at least
one defined value. In function assertSkippableTransitionResult
(OnboardStateResult), replace the Object.keys(result.updates).length === 0 check
with a check that inspects Object.values(result.updates) and returns early
unless values.some(v => v !== undefined); only throw the "Cannot skip onboarding
state result with context updates" error when there is at least one defined
(non-undefined) update value.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 0e5b25c3-1d9f-4a76-8aa2-b34c22e486ce

📥 Commits

Reviewing files that changed from the base of the PR and between 93adbc7 and c5d3d1c.

📒 Files selected for processing (8)
  • src/lib/onboard.ts
  • src/lib/onboard/machine/runner.test.ts
  • src/lib/onboard/machine/runner.ts
  • src/lib/onboard/machine/runtime.ts
  • src/lib/onboard/machine/transitions.test.ts
  • src/lib/onboard/machine/types.ts
  • src/lib/onboard/runtime-boundary.test.ts
  • src/lib/onboard/runtime-boundary.ts

Comment thread src/lib/onboard/machine/runner.ts
Comment thread src/lib/onboard/runtime-boundary.ts
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 26988091343
Target ref: ed9a7391ecc53ebe9d60c19befbbab01f3bea7cb
Workflow ref: main
Requested jobs: onboard-resume-e2e,cloud-onboard-e2e
Summary: 2 passed, 0 failed, 0 skipped

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

@cv cv merged commit d5d2339 into main Jun 5, 2026
27 checks passed
@cv cv deleted the stack/onboard-fsm-consume-results-compat branch June 5, 2026 00:53
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 26988404011
Target ref: 9372e41141628222f554ff24c21fc2dcd3f42fdb
Workflow ref: main
Requested jobs: cloud-onboard-e2e,onboard-resume-e2e,hermes-e2e
Summary: 3 passed, 0 failed, 0 skipped

Job Result
cloud-onboard-e2e ✅ success
hermes-e2e ✅ success
onboard-resume-e2e ✅ success

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 area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow refactor PR restructures code without intended behavior change v0.0.60 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants