fix : Custom providers with empty API keys show as configured in desktop (#6105)

Signed-off-by: Abhijay007 <Abhijay007j@gmail.com>
This commit is contained in:
Abhijay Jain
2025-12-17 01:48:54 +05:30
committed by GitHub
parent 3e37f9c512
commit 9dc9f208f3
+1 -3
View File
@@ -94,13 +94,11 @@ pub fn inspect_keys(
pub fn check_provider_configured(metadata: &ProviderMetadata, provider_type: ProviderType) -> bool {
let config = Config::global();
// TODO(Douwe): if the provider doesn't need an API key, it should be considered configured always
if provider_type == ProviderType::Custom || provider_type == ProviderType::Declarative {
if let Ok(loaded_provider) = load_provider(metadata.name.as_str()) {
return config
.get_secret::<String>(&loaded_provider.config.api_key_env)
.map(|s| !s.is_empty())
.unwrap_or(false);
.is_ok();
}
}
// Special case: Zero-config providers (no config keys)