Agents: Fix Gemini schema compatibility and robust model discovery

This commit is contained in:
Jake authored and Peter Steinberger committed 2026-01-03 13:57:29 +01:00
1 parent c2a74d6d2a
commit 81f4a7cdb7
2 files changed
+79 -5

No files matched your search

+7 -1
View File
@@ -62,8 +62,14 @@ export async function loadModelCatalog(params?: {
typeof entry?.reasoning === "boolean" ? entry.reasoning : undefined;
models.push({ id, name, provider, contextWindow, reasoning });
}
if (models.length === 0) {
// If we found nothing, don't cache this result so we can try again.
modelCatalogPromise = null;
}
} catch {
// Leave models empty on discovery errors.
// Leave models empty on discovery errors and don't cache.
modelCatalogPromise = null;
}
return models.sort((a, b) => {