fix(wizard): defer success summary until gateway ready
Some checks failed
ci/woodpecker/push/ci Pipeline was canceled
ci/woodpecker/pr/ci Pipeline was successful

This commit is contained in:
Jarvis
2026-06-25 12:51:54 -05:00
parent 0883fb91ec
commit e495d8845f
6 changed files with 198 additions and 66 deletions

View File

@@ -310,8 +310,11 @@ async function runFinishPath(
await skillsSelectStage(prompter, state);
}
// Finalize (writes configs, links runtime assets, syncs skills)
await finalizeStage(prompter, state, configService);
// Finalize writes configs/assets/skills, but defer the success summary until
// after the gateway health/bootstrap gates complete.
const finalizeResult = await finalizeStage(prompter, state, configService, {
deferSummary: true,
});
// Gateway stages
if (!options.skipGateway) {
@@ -333,12 +336,16 @@ async function runFinishPath(
if (!bootstrapResult.completed) {
prompter.warn('Admin bootstrap failed — aborting wizard.');
process.exit(1);
return;
}
finalizeResult.showSummary();
}
} catch (err) {
prompter.warn(`Gateway setup failed: ${err instanceof Error ? err.message : String(err)}`);
throw err;
}
} else {
finalizeResult.showSummary();
}
}
@@ -374,8 +381,11 @@ async function runHeadlessPath(
// Skills
await skillsSelectStage(prompter, state);
// Finalize
await finalizeStage(prompter, state, configService);
// Finalize writes configs/assets/skills, but defer the success summary until
// after the gateway health/bootstrap gates complete.
const finalizeResult = await finalizeStage(prompter, state, configService, {
deferSummary: true,
});
// Gateway stages
if (!options.skipGateway) {
@@ -392,20 +402,25 @@ async function runHeadlessPath(
if (!configResult.ready || !configResult.host || !configResult.port) {
prompter.warn('Gateway configuration failed in headless mode — aborting wizard.');
process.exit(1);
} else {
const bootstrapResult = await gatewayBootstrapStage(prompter, state, {
host: configResult.host,
port: configResult.port,
});
if (!bootstrapResult.completed) {
prompter.warn('Admin bootstrap failed — aborting wizard.');
process.exit(1);
}
return;
}
const bootstrapResult = await gatewayBootstrapStage(prompter, state, {
host: configResult.host,
port: configResult.port,
});
if (!bootstrapResult.completed) {
prompter.warn('Admin bootstrap failed — aborting wizard.');
process.exit(1);
return;
}
finalizeResult.showSummary();
} catch (err) {
prompter.warn(`Gateway setup failed: ${err instanceof Error ? err.message : String(err)}`);
throw err;
}
} else {
finalizeResult.showSummary();
}
}
@@ -426,8 +441,11 @@ async function runKeepPath(
// Skills
await skillsSelectStage(prompter, state);
// Finalize
await finalizeStage(prompter, state, configService);
// Finalize writes configs/assets/skills, but defer the success summary until
// after the gateway health/bootstrap gates complete.
const finalizeResult = await finalizeStage(prompter, state, configService, {
deferSummary: true,
});
// Gateway stages
if (!options.skipGateway) {
@@ -447,11 +465,15 @@ async function runKeepPath(
if (!bootstrapResult.completed) {
prompter.warn('Admin bootstrap failed — aborting wizard.');
process.exit(1);
return;
}
finalizeResult.showSummary();
}
} catch (err) {
prompter.warn(`Gateway setup failed: ${err instanceof Error ? err.message : String(err)}`);
throw err;
}
} else {
finalizeResult.showSummary();
}
}