mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user