Merge pull request #7523 from continuedev/fix-config-load

fix: Don't fail on non-fatal errors in CLI
This commit is contained in:
Nate Sesti 2025-09-02 09:51:18 -07:00 • committed by GitHub
commit 8e8ffcaf37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;