diff --git a/extensions/cli/src/configLoader.ts b/extensions/cli/src/configLoader.ts index 79e3cc9f3..3fe00fd21 100644 --- a/extensions/cli/src/configLoader.ts +++ b/extensions/cli/src/configLoader.ts @@ -229,9 +229,18 @@ async function loadUserAssistantWithFallback( if (assistants.length > 0) { const result = assistants[0].configResult; - if (result.errors?.length || !result.config) { + if (!result.config) { throw new Error(result.errors?.join("\n") ?? "Failed to load assistant."); } + + const errors = result.errors; + if (errors?.some((e: any) => e.fatal)) { + throw new Error( + errors.map((e: any) => e.message).join("\n") ?? + "Failed to load assistant.", + ); + } + return result.config as AssistantUnrolled; } @@ -373,8 +382,12 @@ async function loadAssistantSlug( }); const result = resp.configResult; - if (result.errors?.length || !result.config) { - throw new Error(result.errors?.join("\n") ?? "Failed to load assistant."); + const errors = result.errors; + if (errors?.some((e: any) => e.fatal)) { + throw new Error( + errors.map((e: any) => e.message).join("\n") ?? + "Failed to load assistant.", + ); } return result.config as AssistantUnrolled;