This commit is contained in:
Ahmed Ibrahim
2026-01-05 09:22:04 -08:00
parent a944b0ebf1
commit ff5f74b6bf
3 changed files with 146 additions and 146 deletions
+2 -2
View File
@@ -82,6 +82,7 @@ impl ModelsManager {
/// Fetch the latest remote models, using the on-disk cache when still fresh.
pub async fn refresh_available_models_with_cache(&self, config: &Config) -> CoreResult<()> {
let _refresh_guard = self.refresh_lock.lock().await;
if !config.features.enabled(Feature::RemoteModels)
|| self.auth_manager.get_auth_mode() == Some(AuthMode::ApiKey)
{
@@ -93,11 +94,10 @@ impl ModelsManager {
self.refresh_available_models_no_cache().await
}
pub(crate) async fn refresh_available_models_no_cache(&self) -> CoreResult<()> {
async fn refresh_available_models_no_cache(&self) -> CoreResult<()> {
if self.auth_manager.get_auth_mode() == Some(AuthMode::ApiKey) {
return Ok(());
}
let _refresh_guard = self.refresh_lock.lock().await;
let auth = self.auth_manager.auth();
let api_provider = self.provider.to_api_provider(Some(AuthMode::ChatGPT))?;
let api_auth = auth_provider_from_auth(auth.clone(), &self.provider).await?;