Agents: Fix Gemini schema compatibility and robust model discovery

This commit is contained in:
Jake
2026-01-03 20:43:32 +13:00
committed by Peter Steinberger
parent c2a74d6d2a
commit 81f4a7cdb7
2 changed files with 79 additions and 5 deletions

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) => {