{"record":{"id":"0cc9c4f86971e569","repo":"aaif-goose/goose","slug":"provider-has-dynamic-models-false-but-no-sta","errorCode":null,"errorMessage":"Provider '{}' has dynamic_models: false but no static models listed; at least one entry in `models` is required.","messagePattern":"Provider '(.+?)' has dynamic_models: false but no static models listed; at least one entry in `models` is required\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/goose-providers/src/anthropic.rs","lineNumber":400,"sourceCode":"pub fn from_declarative_config(\n    config: DeclarativeProviderConfig,\n    tls_config: Option<TlsConfig>,\n    key_resolver: impl KeyResolver,\n) -> Result<AnthropicProviderBuilder> {\n    let custom_models = if !config.models.is_empty() {\n        Some(\n            config\n                .models\n                .iter()\n                .map(|m| m.name.clone())\n                .collect::<Vec<String>>(),\n        )\n    } else {\n        None\n    };\n\n    if config.dynamic_models == Some(false) && custom_models.is_none() {\n        return Err(anyhow::anyhow!(\n            \"Provider '{}' has dynamic_models: false but no static models listed; \\\n             at least one entry in `models` is required.\",\n            config.name\n        ));\n    }\n\n    let api_key = if config.api_key_env.is_empty() {\n        None\n    } else {\n        match key_resolver.resolve_key(config.api_key_env.as_str()) {\n            Ok(key) => Some(key),\n            Err(err) => {\n                if config.requires_auth {\n                    anyhow::bail!(\"missing required key {}: {}\", config.api_key_env, err);\n                }\n                None\n            }\n        }","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/crates/goose-providers/src/anthropic.rs#L382-L418","documentation":"When building the Anthropic provider from a custom provider config, goose resolves the model list: if dynamic_models is explicitly false, the static models array is the only source of models. This error means the config declared dynamic_models: false but listed no models entries, leaving the provider with no way to serve or list any model.","triggerScenarios":"A providers.yaml/config entry of type anthropic with dynamic_models: false and either no models key or an empty models list. Raised at provider construction time (goose configure / startup), before any request is made.","commonSituations":"Users pinning static model lists for air-gapped or proxied Anthropic deployments but forgetting the models block; copying a template that had dynamic_models: false with the models stripped; setting dynamic_models: false intentionally to stop remote model fetching while expecting built-in defaults (there are none for custom providers).","solutions":["Add at least one entry under models in the provider config, e.g. models: [{name: claude-sonnet-4-5}]","Or allow dynamic model fetching: set dynamic_models: true (or remove the key to use the default)","Re-run goose configure to validate the provider loads without the error"],"exampleFix":"# before\nname: my-anthropic\ntype: anthropic\ndynamic_models: false\n\n# after\nname: my-anthropic\ntype: anthropic\ndynamic_models: false\nmodels:\n  - name: claude-sonnet-4-5\n  - name: claude-opus-4-1","handlingStrategy":"validation","validationCode":"fn anthropic_config_is_loadable(cfg: &ProviderConfig) -> bool {\n    cfg.dynamic_models != Some(false) || !cfg.models.is_empty()\n}\n\nif !anthropic_config_is_loadable(&cfg) {\n    anyhow::bail!(\"fix config before starting: add models or enable dynamic_models\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate providers.yaml at CI time with a config-lint step that applies this rule","Treat dynamic_models: false as 'my models list is the source of truth' and populate it in the same edit","Run goose configure after every provider config change to fail fast at startup"],"tags":["rust","anthropic","config","models","startup"],"backgroundTag":null,"analyzedSha":"3810898a7447ec3299be72e223d3570a7aabf0ab","analyzedAt":"2026-08-16T10:14:26.282Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}