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
+4 -1
View File
@@ -16,6 +16,7 @@ import type {
} from "./SetupTypes.js";
import type { SetupClient } from "./SupportedClients.js";
import type { DoctorScope } from "./Doctor.js";
import type { DoctorReport } from "./Doctor.js";
/** Read-only setup facts shared by client selection and preflight. */
export interface SetupDiscovery {
@@ -36,8 +37,10 @@ export const discoverSetupState = async (input: {
readonly forceHopperInstall: boolean;
readonly proposeHopper: boolean;
readonly doctorScope: DoctorScope | undefined;
readonly initialDoctor?: DoctorReport;
}): Promise<SetupDiscovery> => {
const initialDoctor = await input.host.doctor(input.doctorScope);
const initialDoctor =
input.initialDoctor ?? (await input.host.doctor(input.doctorScope));
const linuxHopperRepairNeeded = initialDoctor.checks.some(
({ name, ok, detail }) =>
!ok &&