{"record":{"id":"99a9eac356b327c3","repo":"Hmbown/CodeWhale","slug":"invalid-configured-model-model-for-provider-expected-auto-or","errorCode":null,"errorMessage":"Invalid configured model '{model}' for provider '{}': expected auto or a model ID this provider serves{hint}.","messagePattern":"Invalid configured model '(.+?)' for provider '(.+?)': expected auto or a model ID this provider serves(.+?)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/config.rs","lineNumber":5155,"sourceCode":"            && !self.active_provider_preserves_custom_base_url_model()\n            && crate::provider_lake::configured_model_for_route(\n                self,\n                active_provider,\n                &self.provider_identity_for(active_provider),\n                &self.base_url_for_route(active_provider),\n                model,\n            )\n            .is_none()\n            && canonical_model_id_for_provider(self.api_provider(), model).is_none()\n        {\n            let provider = self.api_provider();\n            let known = model_completion_names_for_provider(provider);\n            let hint = if known.is_empty() {\n                String::new()\n            } else {\n                format!(\" (for example: {})\", known.join(\", \"))\n            };\n            anyhow::bail!(\n                \"Invalid configured model '{model}' for provider '{}': expected auto or a model ID this provider serves{hint}.\",\n                provider.as_str()\n            );\n        }\n        if let Some(policy) = self.approval_policy.as_deref() {\n            let normalized = policy.trim().to_ascii_lowercase();\n            if !matches!(\n                normalized.as_str(),\n                \"on-request\" | \"untrusted\" | \"never\" | \"auto\" | \"suggest\"\n            ) {\n                anyhow::bail!(\n                    \"Invalid approval_policy '{policy}': expected on-request, untrusted, never, auto, or suggest.\"\n                );\n            }\n        }\n        if let Some(v) = self.verbosity.as_deref() {\n            let normalized = v.trim().to_ascii_lowercase();\n            if !matches!(normalized.as_str(), \"normal\" | \"concise\") {","sourceCodeStart":5137,"sourceCodeEnd":5173,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/config.rs#L5137-L5173","documentation":"The config validator checks the configured model against the model ID namespace of the *active* provider via `model_completion_names_for_provider(provider)`. Only `auto` or a model ID that provider actually serves is accepted; anything else is rejected with a hint listing example valid IDs.","triggerScenarios":"`Config::validate` runs and the configured `model` value is neither the literal `auto` nor one of the completion names returned by `model_completion_names_for_provider` for the currently selected provider.","commonSituations":"Switching providers (e.g. from DeepSeek to OpenRouter) but keeping the old provider's model ID; typos in the model string; using a model name that the provider retired or never served; copying a model ID from another tool's config.","solutions":["Set `model = \"auto\"` in the config to let the provider resolver pick the model.","Pick a model ID from the hint list in the error message (examples come from `model_completion_names_for_provider` for your active provider).","If you switched providers, also update `api_provider` so the model is validated against the intended namespace.","Verify the model ID is one the provider currently serves (provider may have deprecated it)."],"exampleFix":"// before (config.toml)\nmodel = \"gpt-4o\"   # active provider is openrouter\n\n// after\nmodel = \"auto\"\n# or\nmodel = \"openai/gpt-4o\"","handlingStrategy":"validation","validationCode":"use codewhale::tui::config::model_completion_names_for_provider;\nlet known = model_completion_names_for_provider(provider);\nlet ok = model == \"auto\" || known.iter().any(|m| *m == model);\nassert!(ok, \"model '{model}' not served by {}; valid: {known:?}\", provider.as_str());","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use `model = \"auto\"` unless you specifically need a pinned model.","After switching providers, always update the model ID in the same edit.","Pick model IDs from the completion list the CLI offers, not from memory or other tools."],"tags":["config","validation","model"],"backgroundTag":"invalid-config-value","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T16:17:23.217Z"}