{"record":{"id":"05026a7d166ed793","repo":"Hmbown/CodeWhale","slug":"invalid-provider-provider-expected","errorCode":null,"errorMessage":"Invalid provider '{provider}': expected {}.","messagePattern":"Invalid provider '(.+?)': expected (.+?)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/config.rs","lineNumber":5091,"sourceCode":"            self.custom_models.as_deref().unwrap_or_default(),\n        )?;\n        self.openrouter_vendor()?;\n        if self\n            .provider\n            .as_deref()\n            .is_some_and(is_legacy_antigravity_identity)\n        {\n            anyhow::bail!(codewhale_config::LEGACY_ANTIGRAVITY_TOMBSTONE_MESSAGE);\n        }\n        if let Some(provider) = self.provider.as_deref()\n            && ApiProvider::parse(provider).is_none()\n            && self\n                .providers\n                .as_ref()\n                .and_then(|providers| providers.custom_provider_config(provider))\n                .is_none()\n        {\n            anyhow::bail!(\n                \"Invalid provider '{provider}': expected {}.\",\n                ApiProvider::names_hint()\n            );\n        }\n        let active_provider = self.api_provider();\n        match validate_kimi_code_api_model_id(\n            active_provider,\n            &self.active_route_base_url(),\n            &self.default_model(),\n        ) {\n            Err(error) if error == KIMI_CODE_CLAUDE_ALIAS_GUIDANCE => {\n                return Err(SafeConfigDiagnostic::KimiCodeClaudeAlias.into());\n            }\n            result => result.map_err(anyhow::Error::msg)?,\n        }\n        if let Some(ref key) = self.api_key\n            && key.trim().is_empty()\n        {","sourceCodeStart":5073,"sourceCodeEnd":5109,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/config.rs#L5073-L5109","documentation":"Provider names are validated against the known ApiProvider set plus any configured custom providers. An unrecognized provider name that is not a custom provider fails with a hint listing valid names. Thrown at config.rs:5091.","triggerScenarios":"`self.provider` is set, ApiProvider::parse(provider) returns None, and providers.custom_provider_config(provider) is also None — i.e. the name matches neither a built-in nor a user-defined custom provider.","commonSituations":"Typo like provider = \"anthrpic\"; referencing a custom provider before defining it under [providers]; using a provider name from another tool's vocabulary; casing/format drift after normalization changes.","solutions":["Correct the provider name to one from the hint (ApiProvider::names_hint()).","If it is meant to be a custom provider, define it under [providers.<name>] with custom_provider_config.","Check for typos or stale names in env/config/scripts (e.g. retired antigravity — see error 817)."],"exampleFix":"// before\nprovider = \"googel\"\n// after\nprovider = \"google\"","handlingStrategy":"validation","validationCode":"if ApiProvider::parse(provider).is_none() && custom_providers.get(provider).is_none() {\n    return Err(format!(\"unknown provider '{provider}'\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep provider names in a shared constant list, not free-typed strings.","Define custom providers before referencing them elsewhere in config."],"tags":["config","provider","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}