fix(providers): honor dynamic_models: false in declarative provider configs (#8795)

Signed-off-by: Douwe Osinga <douwe@squareup.com>
Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Mihir Gupta
2026-05-12 15:07:36 -04:00
committed by GitHub
parent f2df168bec
commit 15bfe4f5d5
5 changed files with 247 additions and 12 deletions
@@ -86,6 +86,12 @@ pub struct DeclarativeProviderConfig {
pub base_path: Option<String>,
#[serde(default)]
pub env_vars: Option<Vec<EnvVarConfig>>,
/// Controls whether `fetch_supported_models` calls the provider's `/v1/models`
/// endpoint or returns the static `models` list directly.
///
/// - `Some(false)` + non-empty `models`: return the static list; no API call.
/// Construction fails if `models` is empty.
/// - `Some(true)` or `None`: try the API; fall back to `models` on 404.
#[serde(default)]
pub dynamic_models: Option<bool>,
#[serde(default)]