fix(backend): validate configured model provider pair

This commit is contained in:
User
2026-07-14 18:39:37 +02:00
parent c463de8da2
commit 3d23d0543c
5 changed files with 61 additions and 7 deletions
+5 -1
View File
@@ -34,7 +34,11 @@ export function metaRoutes(
const fn = deps.listModels ?? (async () => []);
try {
return { models: await fn() };
} catch {
} catch (error) {
app.log.warn({
component: "pi-model-list",
errorType: error instanceof Error ? error.name : typeof error,
}, "Pi model listing failed");
// Graceful fallback: Pi may not be running; don't crash the server.
return { models: [] as PiModel[] };
}