perf(setup): reuse initial diagnostics during planning (#940)

* perf(setup): reuse initial diagnostics during planning

* test(setup): verify post-configuration doctor refresh

* style(setup): remove extra test spacing
This commit is contained in:
morluto
2026-10-07 19:52:43 +08:00
committed by GitHub
parent c92a344d47
commit 118d43e787
6 changed files with 105 additions and 4 deletions
+12 -2
View File
@@ -42,8 +42,15 @@ export const runSetup = async (
);
const unsupported = await hostRemediation(host, false);
if (unsupported !== undefined) return fail(unsupported);
let hopperPath = await host.hopperPath();
let providerEnvironment = await initialProviderEnvironment(host, hopperPath);
const initialState = await host.initialSetupState?.(options.readinessScope);
let hopperPath =
initialState === undefined
? await host.hopperPath()
: initialState.hopperPath;
let providerEnvironment =
initialState === undefined
? await initialProviderEnvironment(host, hopperPath)
: initialState.providerEnvironment;
const discovery = await discoverSetupState({
host,
providerEnvironment,
@@ -51,6 +58,9 @@ export const runSetup = async (
proposeHopper:
options.proposeHopper ?? (confirm !== undefined && !options.structured),
doctorScope: options.readinessScope,
...(initialState === undefined
? {}
: { initialDoctor: initialState.doctor }),
});
clientStates = discovery.clientStates;
const clientSelectionAllowed =