← Back to PRs

#5880: fix(wizard): resume interrupted installation from last completed step

by gavinbmoore open 2026-02-01 03:07 View on GitHub →
## Summary Fixes #5804 When the installation wizard is interrupted (e.g., by `Ctrl+Z` + `kill %%`), subsequent runs now detect the incomplete state and offer to resume from where it left off. ## Changes - Add `wizard-state.ts` module to persist wizard progress to disk - Track completion of each major wizard step (risk-ack, flow-select, channels, etc.) - On wizard start, detect incomplete state and prompt user to resume or restart - Skip already-completed steps when resuming - Clear state file on successful wizard completion ## Implementation Details The wizard state is stored in `$OPENCLAW_STATE_DIR/wizard-state.json` and includes: - `lastCompletedStep`: The most recent step that was fully completed - `answers`: Collected user choices (flow type, auth choice, model selection, etc.) - `completed`: Boolean flag indicating successful completion ## User Experience When an incomplete wizard is detected, the user sees: ``` ┌ Incomplete setup detected │ │ A previous setup was interrupted. │ Last completed step: channels │ Would resume from: skills │ └ ○ How would you like to proceed? │ ○ Resume where I left off — Continue from the last completed step │ ○ Start fresh — Begin setup from the beginning └ ``` ## Testing - 22 unit tests for wizard-state module (all passing) - TypeScript compiles cleanly - Lint passes (on new code) <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds a persisted `wizard-state.json` (under `OPENCLAW_STATE_DIR`) and wires onboarding to detect an interrupted wizard run, prompt the user to resume or restart, and attempt to skip already-completed steps. It introduces a new `src/wizard/wizard-state.ts` module with load/save/update helpers plus unit tests, and updates `runOnboardingWizard` to checkpoint progress during key steps and clear state on successful completion. Main concerns are around the resume logic not actually skipping most steps (due to state not being updated in-memory and several steps not being gated), and a behavior change where skipping `channels` also skips writing the updated config to disk. <h3>Confidence Score: 2/5</h3> - This PR has user-facing resume logic issues that likely prevent correct resumption in common cases. - While the new wizard-state module is straightforward and well-tested, the onboarding integration appears to have multiple logic gaps: resumed runs won’t skip most steps as intended, and resuming past channels can skip persisting config updates. These are likely to be hit by real users resuming interrupted installs. - src/wizard/onboarding.ts, src/wizard/wizard-state.ts <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs