fix: better handling of empty model catalog

This commit is contained in:
2026-03-01 17:09:29 +01:00
parent 63674266f5
commit c02ddc6d7a
2 changed files with 12 additions and 0 deletions

View File

@@ -2167,6 +2167,15 @@ NOTE: Use pagination (offset/limit) in list_posts and search_posts to access all
return this.modelCatalogEngine;
}
/**
* Invalidate the in-memory model cache so the next getAvailableModels()
* re-fetches and re-cross-references with the catalog.
*/
invalidateModelCache(): void {
this.cachedModels = null;
this.cachedModelsAt = 0;
}
/**
* Check whether the given provider's API key is configured.
* All non-mistral providers are routed through OpenCode Zen and share apiKey.