warnings on config load

This commit is contained in:
Nate 2025-07-19 20:35:07 -07:00
parent 6e4b4bb264
commit ff1d113862
2 changed files with 10 additions and 2 deletions

View file

@ -13,6 +13,7 @@ import {
DefaultApi,
DefaultApiInterface,
} from "@continuedev/sdk/dist/api/dist/index.js";
import chalk from "chalk";
import { dirname } from "node:path";
import {
AuthConfig,
@ -97,9 +98,15 @@ async function loadConfigYaml(
}
);
if (unrollResult.errors?.length || !unrollResult.config) {
const errorDetails = unrollResult.errors?.join("\n") ?? "Unknown error";
const errorDetails = unrollResult.errors;
if (!unrollResult.config) {
throw new Error(`Failed to load config file:\n${errorDetails}`);
} else if (errorDetails?.length) {
const warnings =
errorDetails?.length > 1
? errorDetails.map((d) => `\n- ${d.message}`)
: errorDetails[0].message;
console.warn(chalk.dim(`Warning: ${warnings}`));
}
return unrollResult.config;

View file

@ -132,6 +132,7 @@ export async function runOnboardingFlow(
limitMessage: chalk.dim(
"Please enter a valid Anthropic key that starts with 'sk-ant'"
),
hideEchoBack: true,
}
);