Coding standard: Centralize configuration/credential semantics and never “re-derive” them in multiple places. Read from the real sources (env/config and provider-specific runtime credential caches), preserve provider identity during legacy interop, and let canonical normalizers own final resolution.
Apply this as follows:
ProviderMetadata config keys.normalize_* logic to skip important normalization steps; pass raw model inputs to the canonical normalizer.Example pattern (shared usable gate):
// Single source of truth used by both server + CLI
pub fn provider_is_usable(meta: &ProviderMetadata, provider_type: ProviderType) -> bool {
// handle local override
if meta.name == "local" { return true; }
// OAuth/token-cache-backed providers must consult inventory/configured signals
// (not just meta.config_keys)
if meta.config_keys.iter().any(|k| k.oauth_flow) {
return provider_inventory_configured(meta.name.as_str());
}
// For non-OAuth providers: require explicit config/secret presence (not only defaults)
required_keys_all_present_and_secrets_real(meta)
}
Enter the URL of a public GitHub repository