fix(cli): exit with non-zero code when configure/agents-add wizards are cancelled (#14156)

* fix(cli): exit with non-zero code when configure/agents-add wizards are cancelled

Follow-up to the onboard cancel fix. The configure wizard and
agents add wizard also caught WizardCancelledError and exited with
code 0, which signals success to callers. Change to exit(1) for
consistency — user cancellation is not a successful completion.

This ensures scripts that chain these commands with set -e will
correctly stop when the user cancels.

* fix(cli): make wizard cancellations exit non-zero (#14156) (thanks @0xRaini)

---------

Co-authored-by: Rain <rain@Rains-MBA-M4.local>
Co-authored-by: Sebastian <19554889+sebslight@users.noreply.github.com>
This commit is contained in:
0xRain
2026-02-12 02:07:30 +08:00
committed by GitHub
parent 6758b6bfe4
commit 93411b74a0
7 changed files with 116 additions and 3 deletions

View File

@@ -15,7 +15,7 @@ export async function runInteractiveOnboarding(
await runOnboardingWizard(opts, runtime, prompter);
} catch (err) {
if (err instanceof WizardCancelledError) {
runtime.exit(0);
runtime.exit(1);
return;
}
throw err;