{"record":{"id":"5a77086b3e781a6b","repo":"Hmbown/CodeWhale","slug":"advisor-model-belongs-to-a-custom-provider-but-no-exact","errorCode":null,"errorMessage":"advisor model `{}` belongs to a custom provider but no exact provider identity is carried","messagePattern":"advisor model `(.+?)` belongs to a custom provider but no exact provider identity is carried","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/tools/subagent/advisor.rs","lineNumber":477,"sourceCode":"    session_model: &str,\n    requested_model: &str,\n) -> anyhow::Result<(CodewhaleClient, String)> {\n    if requested_model\n        .trim()\n        .eq_ignore_ascii_case(session_model.trim())\n    {\n        return Ok((parent_client, session_model.trim().to_string()));\n    }\n\n    if config.providers.as_ref().is_some_and(|providers| {\n        providers.custom.values().any(|provider| {\n            provider\n                .model\n                .as_deref()\n                .is_some_and(|model| model.trim().eq_ignore_ascii_case(requested_model.trim()))\n        })\n    }) {\n        anyhow::bail!(\n            \"advisor model `{}` belongs to a custom provider but no exact provider identity is carried\",\n            requested_model.trim()\n        );\n    }\n\n    let selection =\n        crate::model_routing::resolve_explicit_route_with_inventory(config, requested_model);\n    let (provider, model) = if let Some(selection) = selection {\n        if selection.provider == crate::config::ApiProvider::Custom {\n            anyhow::bail!(\n                \"advisor model `{}` resolved only to a custom provider kind without an exact provider identity\",\n                requested_model.trim()\n            );\n        }\n        (selection.provider, selection.model)\n    } else {\n        let candidates =\n            crate::model_routing::explicit_route_candidate_providers(config, requested_model);","sourceCodeStart":459,"sourceCodeEnd":495,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/tools/subagent/advisor.rs#L459-L495","documentation":"exact_advisor_client routes an advisor model override to a provider client. When the requested model is found among custom providers, it requires an exact provider identity (the specific configured custom provider that owns the model). If no provider carrying that exact identity matches, it fails closed rather than guessing which custom provider to use.","triggerScenarios":"Requesting an advisor model that is defined under a custom (user-defined) provider while the request/route carries no exact custom-provider identity — e.g. an advisor_model override naming a model from a named custom provider, with the owning provider's exact identifier absent, or the model name matching Custom A while the identity points at Custom B.","commonSituations":"Multiple custom providers configured with overlapping/identical model names; renaming a custom provider so stored overrides no longer carry the exact identity; copying an advisor override between machines/profiles with different custom provider configs.","solutions":["Configure the advisor override with the full owning provider identity (exact custom provider id), not just the model name","Ensure the model name is unique across custom providers, or rename to avoid collisions","Re-create the override against the current (renamed/re-added) custom provider so the identity matches"],"exampleFix":"// before\nadvisor_model: \"my-finetune\"  // ambiguous: two custom providers define it\n// after\nadvisor_model: \"my-finetune\" with provider identity pinned to custom provider \"custom-a\"","handlingStrategy":"validation","validationCode":"// ensure the override carries the owning custom provider id and the model is unique across custom providers","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin the exact custom provider identity in advisor overrides, not just the model name","Keep model names unique across custom providers","Re-create overrides after renaming custom providers"],"tags":["advisor","model-routing","custom-provider","identity"],"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-23T08:17:48.524Z"}