From a4d1c4d522eda1eaabb986b9d429014348d27dd0 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 20 Jan 2026 13:27:47 +0000 Subject: [PATCH] fix: run doctor config flow once --- src/cli/program/config-guard.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/cli/program/config-guard.ts b/src/cli/program/config-guard.ts index 0d984bcaf..f8e3576f6 100644 --- a/src/cli/program/config-guard.ts +++ b/src/cli/program/config-guard.ts @@ -5,6 +5,7 @@ import type { RuntimeEnv } from "../../runtime.js"; import { formatCliCommand } from "../command-format.js"; const ALLOWED_INVALID_COMMANDS = new Set(["doctor", "logs", "health", "help", "status", "service"]); +let didRunDoctorConfigFlow = false; function formatConfigIssues(issues: Array<{ path: string; message: string }>): string[] { return issues.map((issue) => `- ${issue.path || ""}: ${issue.message}`); @@ -14,10 +15,13 @@ export async function ensureConfigReady(params: { runtime: RuntimeEnv; commandPath?: string[]; }): Promise { - await loadAndMaybeMigrateDoctorConfig({ - options: { nonInteractive: true }, - confirm: async () => false, - }); + if (!didRunDoctorConfigFlow) { + didRunDoctorConfigFlow = true; + await loadAndMaybeMigrateDoctorConfig({ + options: { nonInteractive: true }, + confirm: async () => false, + }); + } const snapshot = await readConfigFileSnapshot(); const commandName = params.commandPath?.[0];