fix: avoid duplicate doctor config output
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
resolveHooksGmailModel,
|
||||
} from "../agents/model-selection.js";
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import { CONFIG_PATH_CLAWDBOT, writeConfigFile } from "../config/config.js";
|
||||
import { CONFIG_PATH_CLAWDBOT, readConfigFileSnapshot, writeConfigFile } from "../config/config.js";
|
||||
import { resolveGatewayService } from "../daemon/service.js";
|
||||
import { buildGatewayConnectionDetails } from "../gateway/call.js";
|
||||
import { resolveClawdbotPackageRoot } from "../infra/clawdbot-root.js";
|
||||
@@ -269,5 +269,14 @@ export async function doctorCommand(
|
||||
}
|
||||
}
|
||||
|
||||
const finalSnapshot = await readConfigFileSnapshot();
|
||||
if (finalSnapshot.exists && !finalSnapshot.valid) {
|
||||
runtime.error("Invalid config:");
|
||||
for (const issue of finalSnapshot.issues) {
|
||||
const path = issue.path || "<root>";
|
||||
runtime.error(`- ${path}: ${issue.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
outro("Doctor complete.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user