{"record":{"id":"5e7d406809f2fac8","repo":"Hmbown/CodeWhale","slug":"invalid-model-model-for-provider","errorCode":null,"errorMessage":"invalid model '{model}' for provider '{}'","messagePattern":"invalid model '(.+?)' for provider '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/config_ui.rs","lineNumber":892,"sourceCode":"    if model.is_empty() {\n        bail!(\n            \"invalid model '{model}' for provider '{}'\",\n            provider.as_str()\n        );\n    }\n    if model.eq_ignore_ascii_case(\"auto\") {\n        // Still run the provider gate so empty/unknown providers cannot sneak\n        // an `auto` through without the same checks as `/model auto`.\n        validate_route(provider, model).map_err(anyhow::Error::msg)?;\n        return Ok(\"auto\".to_string());\n    }\n\n    // OpenCode Go is protocol-bound (Chat Completions only) even when its base\n    // URL is overridden — never open the custom-endpoint passthrough for it.\n    if provider == crate::config::ApiProvider::OpencodeGo {\n        validate_route(provider, model).map_err(anyhow::Error::msg)?;\n        return normalize_model_name_for_provider(provider, model).ok_or_else(|| {\n            anyhow::anyhow!(\n                \"invalid model '{model}' for provider '{}'\",\n                provider.as_str()\n            )\n        });\n    }\n\n    // Custom / self-hosted endpoints own their model id namespace. Match the\n    // request path (`wire_model_for_provider_route`) so saving `/config` on a\n    // custom deepseek gateway does not reject a non-DeepSeek wire id the\n    // session is already running.\n    if config.provider_uses_custom_endpoint(provider) {\n        return normalize_custom_model_id(model).ok_or_else(|| {\n            anyhow::anyhow!(\n                \"invalid model '{model}' for provider '{}'\",\n                provider.as_str()\n            )\n        });\n    }","sourceCodeStart":874,"sourceCodeEnd":910,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/config_ui.rs#L874-L910","documentation":"Error \"invalid model '{model}' for provider '{}'\" thrown in Hmbown/CodeWhale.","triggerScenarios":"Thrown at crates/tui/src/config_ui.rs:892 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}