#5880: fix(wizard): resume interrupted installation from last completed step
Cluster:
Wizard Enhancements and Config Fixes
## 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
#7762: feat: add 'go back' navigation to onboarding wizard
by SalimBinYousuf1 · 2026-02-03
77.0%
#6624: Web Configure Wizard: channels + skills + agent runtime + diff + do...
by Oruga420 · 2026-02-01
74.2%
#20504: fix: ESC returns to previous menu in configure wizard
by MisterGuy420 · 2026-02-19
72.3%
#16301: fix: preserve custom config keys during configure wizard
by superlowburn · 2026-02-14
71.9%
#13849: fix(configure): preserve custom config keys across wizard sections
by mcaxtr · 2026-02-11
70.6%
#15306: fix: explicit exit after onboarding command completes
by jeroenbaas · 2026-02-13
69.0%
#6060: feat(onboarding): add Memory Optimization step to onboarding wizard
by GodsBoy · 2026-02-01
68.1%
#13577: fix(onboard): validate workspace directory before setup steps
by mcaxtr · 2026-02-10
67.6%
#3045: [AI-Assisted] fix: preserve pending tasks when subagent completes
by sid1943 · 2026-01-28
67.5%
#6888: feat: PowerShell completion install/uninstall + templates script + ...
by ThinkIbrokeIt · 2026-02-02
67.3%