Skip to content

Commit 80029fe

Browse files
Cancel wizard sessions before retrying setup
Validated with GitHub CI, .\build.ps1, OpenClaw.Shared.Tests, and OpenClaw.Tray.Tests.
1 parent edf06da commit 80029fe

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/OpenClaw.SetupEngine.UI/Pages/WizardPage.xaml.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ private async Task StartWizardAsync()
5656
{
5757
_errorState = false;
5858
HideRecoveryActions();
59-
await DisconnectAsync();
59+
// Cancel any in-progress server-side wizard session before starting a
60+
// fresh one, so the gateway doesn't reject wizard.start with "wizard
61+
// already running" when recovering from a previous error.
62+
await CancelCurrentSessionAsync();
6063
ClearConsoleBanner();
6164
_sessionId = "";
6265
_wizardStepCount = 0;
@@ -748,7 +751,10 @@ private async Task EnterWizardErrorAsync(string detail)
748751
return;
749752

750753
_errorState = true;
751-
await DisconnectAsync();
754+
// Cancel the server-side wizard session before disconnecting so that
755+
// subsequent retries (Start wizard again / Skip wizard) don't hit a
756+
// "wizard already running" error from a lingering gateway session.
757+
await CancelCurrentSessionAsync();
752758
ShowError(detail);
753759
}
754760

0 commit comments

Comments
 (0)