Hmbown/CodeWhale · error

advisor model ` ` belongs to a custom provider but no exact…

Error message

advisor model `{}` belongs to a custom provider but no exact provider identity is carried

What it means

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.

Solutions

  1. Configure the advisor override with the full owning provider identity (exact custom provider id), not just the model name
  2. Ensure the model name is unique across custom providers, or rename to avoid collisions
  3. Re-create the override against the current (renamed/re-added) custom provider so the identity matches

Example fix

// before
advisor_model: "my-finetune"  // ambiguous: two custom providers define it
// after
advisor_model: "my-finetune" with provider identity pinned to custom provider "custom-a"
Defensive patterns

Strategy: validation

Validate before calling

// ensure the override carries the owning custom provider id and the model is unique across custom providers

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/5a77086b3e781a6b. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/tools/subagent/advisor.rs:477

    session_model: &str,
    requested_model: &str,
) -> anyhow::Result<(CodewhaleClient, String)> {
    if requested_model
        .trim()
        .eq_ignore_ascii_case(session_model.trim())
    {
        return Ok((parent_client, session_model.trim().to_string()));
    }

    if config.providers.as_ref().is_some_and(|providers| {
        providers.custom.values().any(|provider| {
            provider
                .model
                .as_deref()
                .is_some_and(|model| model.trim().eq_ignore_ascii_case(requested_model.trim()))
        })
    }) {
        anyhow::bail!(
            "advisor model `{}` belongs to a custom provider but no exact provider identity is carried",
            requested_model.trim()
        );
    }

    let selection =
        crate::model_routing::resolve_explicit_route_with_inventory(config, requested_model);
    let (provider, model) = if let Some(selection) = selection {
        if selection.provider == crate::config::ApiProvider::Custom {
            anyhow::bail!(
                "advisor model `{}` resolved only to a custom provider kind without an exact provider identity",
                requested_model.trim()
            );
        }
        (selection.provider, selection.model)
    } else {
        let candidates =
            crate::model_routing::explicit_route_candidate_providers(config, requested_model);

View on GitHub (pinned to 73e0f67d83)