{"record":{"id":"5e59f2ab2774ede4","repo":"aaif-goose/goose","slug":"invalid-provider-type","errorCode":null,"errorMessage":"Invalid provider type: {}","messagePattern":"Invalid provider type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/goose-providers/src/declarative.rs","lineNumber":106,"sourceCode":"#[serde(rename_all = \"lowercase\")]\npub enum ProviderEngine {\n    #[serde(alias = \"openai_compatible\")]\n    OpenAI,\n    #[serde(alias = \"ollama_compatible\")]\n    Ollama,\n    #[serde(alias = \"anthropic_compatible\")]\n    Anthropic,\n}\n\nimpl FromStr for ProviderEngine {\n    type Err = anyhow::Error;\n\n    fn from_str(engine: &str) -> Result<Self> {\n        match engine.trim().to_lowercase().as_str() {\n            \"openai\" | \"openai_compatible\" => Ok(Self::OpenAI),\n            \"anthropic\" | \"anthropic_compatible\" => Ok(Self::Anthropic),\n            \"ollama\" | \"ollama_compatible\" => Ok(Self::Ollama),\n            _ => Err(anyhow::anyhow!(\"Invalid provider type: {}\", engine)),\n        }\n    }\n}\n\n#[derive(Debug, Clone, Serialize, Deserialize)]\npub struct DeclarativeProviderConfig {\n    pub name: String,\n    pub engine: ProviderEngine,\n    pub display_name: String,\n    pub description: Option<String>,\n    #[serde(default)]\n    pub api_key_env: String,\n    pub base_url: String,\n    pub models: Vec<ModelInfo>,\n    pub headers: Option<HashMap<String, String>>,\n    pub timeout_seconds: Option<u64>,\n    pub supports_streaming: Option<bool>,\n    #[serde(default = \"default_requires_auth\")]","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/crates/goose-providers/src/declarative.rs#L88-L124","documentation":"ProviderEngine::from_str (used when a declarative provider's engine string is parsed, e.g. from config keys or CLI input) accepts only: 'openai'/'openai_compatible', 'anthropic'/'anthropic_compatible', 'ollama'/'ollama_compatible' — matched after trim + lowercase. Any other string, including near-misses like 'openai-compatible' (hyphen), 'OpenAI Compatible' with an unsupported word, or genuinely unsupported engines like 'azure'/'bedrock'/'google', hits this error.","triggerScenarios":"A declarative provider JSON or dynamic provider entry whose 'engine' field/value is outside the six accepted strings; engine strings copied from another tool's config that use hyphens or different names; note serde deserialization of the JSON field uses its own aliases, so this FromStr path typically comes from string-typed sources like GOOSE_PROVIDER-style selection.","commonSituations":"Users hand-write custom provider JSON modeling an API goose has no engine for (Gemini, Bedrock) and assume a generic HTTP engine exists; typos and hyphen/underscore mixups after migrating config between tools.","solutions":["Set engine to one of: openai, openai_compatible, anthropic, anthropic_compatible, ollama, ollama_compatible (case-insensitive; underscores not hyphens)","For OpenAI-API-compatible vendors (Groq, Together, etc.) use a bundled declarative provider or engine 'openai_compatible' with your base_url","For engines goose genuinely doesn't support, use its dedicated built-in provider instead of the declarative path"],"exampleFix":"// before\nlet engine = ProviderEngine::from_str(\"openai-compatible\")?; // Invalid provider type\n\n// after\nlet engine = ProviderEngine::from_str(\"openai_compatible\")?;","handlingStrategy":"validation","validationCode":"const ENGINES: [&str; 6] = [\"openai\", \"openai_compatible\", \"anthropic\", \"anthropic_compatible\", \"ollama\", \"ollama_compatible\"];\nfn engine_ok(raw: &str) -> bool {\n    ENGINES.contains(&raw.trim().to_lowercase().as_str())\n}","typeGuard":"fn is_valid_engine(raw: &str) -> bool {\n    matches!(raw.trim().to_lowercase().as_str(),\n        \"openai\" | \"openai_compatible\" | \"anthropic\" | \"anthropic_compatible\" | \"ollama\" | \"ollama_compatible\")\n}","tryCatchPattern":"let engine = match ProviderEngine::from_str(&raw_engine) {\n    Ok(e) => e,\n    Err(_) if raw_engine.contains('-') => ProviderEngine::from_str(&raw_engine.replace('-', \"_\"))?,\n    Err(e) => return Err(e.context(format!(\"engine '{raw_engine}'; accepted: openai[_compatible], anthropic[_compatible], ollama[_compatible]\"))),\n};","preventionTips":["Validate engine strings at config-load time with the six-value whitelist and fail with the accepted list","Normalize hyphens to underscores (or vice versa) in your config front-end so users can't typo between styles","For unsupported vendors, steer users to the dedicated built-in provider instead of a declarative JSON"],"tags":["configuration","provider-setup","validation","json-config"],"backgroundTag":null,"analyzedSha":"3810898a7447ec3299be72e223d3570a7aabf0ab","analyzedAt":"2026-08-16T10:14:26.282Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}