{"record":{"id":"5cd0e6c8689e9344","repo":"aaif-goose/goose","slug":"provider-not-found","errorCode":null,"errorMessage":"Provider not found: {}","messagePattern":"Provider not found: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/goose/src/config/declarative_providers.rs","lineNumber":348,"sourceCode":"        let content = std::fs::read_to_string(&custom_file_path)?;\n        let config = deserialize_provider_config(&content)?;\n        return Ok(LoadedProvider {\n            config,\n            is_editable: true,\n        });\n    }\n\n    if let Some(config) = fixed_provider_configs()?\n        .into_iter()\n        .find(|config| config.name == id)\n    {\n        return Ok(LoadedProvider {\n            config,\n            is_editable: false,\n        });\n    }\n\n    Err(anyhow::anyhow!(\"Provider not found: {}\", id))\n}\n\npub fn register_declarative_providers(\n    registry: &mut crate::providers::provider_registry::ProviderRegistry,\n) -> Result<()> {\n    let dir = custom_providers_dir();\n    let custom_providers = load_custom_providers(&dir)?;\n    let fixed_providers = fixed_provider_configs()?;\n    for config in fixed_providers {\n        register_declarative_provider(registry, config, ProviderType::Declarative);\n    }\n\n    for config in custom_providers {\n        register_declarative_provider(registry, config, ProviderType::Custom);\n    }\n\n    Ok(())\n}","sourceCodeStart":330,"sourceCodeEnd":366,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/crates/goose/src/config/declarative_providers.rs#L330-L366","documentation":"Provider lookup for declarative providers checks, in order, the JSON files in the custom_providers directory and the fixed built-in declarative provider configs (matched by name). If neither contains the requested id, this error is returned with the id that failed.","triggerScenarios":"Calling get_declarative_provider(\"acme\") when no acme.json exists in the custom_providers dir and no fixed provider is named acme; ids passed with a `.json` suffix, wrong casing, or trailing whitespace; the custom provider file was deleted or renamed.","commonSituations":"Typo in a `--provider` flag or config value; referencing a provider on a machine where it was never created; stale references after renaming a custom provider; appending `.json` because that is the filename.","solutions":["List the actual ids: fixed ids come from the built-in declarative configs, custom ids are the file stems in the custom_providers dir (dir from custom_providers_dir())","Remove any `.json` suffix and correct casing — lookup is exact string equality on config.name","Re-create the missing custom provider if its JSON file was deleted"],"exampleFix":"// before\nlet provider = get_declarative_provider(\"acme.json\")?;\n\n// after\nlet provider = get_declarative_provider(\"acme\")?;","handlingStrategy":"validation","validationCode":"use goose::config::declarative_providers::custom_providers_dir;\n\nfn provider_id_exists(id: &str) -> bool {\n    custom_providers_dir().join(format!(\"{}.json\", id)).exists()\n    // fixed providers are matched by config.name; check the built-in list too\n}","typeGuard":null,"tryCatchPattern":"match get_declarative_provider(id) {\n    Err(e) if e.to_string().starts_with(\"Provider not found\") => {\n        // list available ids and surface a chooser to the user\n    }\n    other => other?,\n}","preventionTips":["Source provider ids from the live registry/custom_providers dir, not hard-coded strings","Strip .json suffixes and match casing exactly","Validate ids right after renaming or deleting a custom provider"],"tags":["providers","lookup","custom-providers","config"],"backgroundTag":null,"analyzedSha":"3810898a7447ec3299be72e223d3570a7aabf0ab","analyzedAt":"2026-08-16T10:14:26.282Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}