Skip to main content

validate_provider_config

Function validate_provider_config 

Source
pub fn validate_provider_config(cfg: &RepoProviderConfig) -> Result<(), String>
Expand description

Statically validate a repo’s provider config for internal coherence, independent of the runtime environment — so settings that would be silently dropped at spawn/poll time are rejected at config-set time with an actionable message instead.

Today this catches an api_key_from_env on a provider that has no api-key env var (ollama, bedrock, vertex, unknown): resolve_env only warn!s "api_key_from_env set but provider has no api-key env var; ignored" and proceeds, so the setting looks accepted but never takes effect. Surfacing it here lets the config-set path return a 400 (#120).

An unset provider always passes (nothing to validate).