Hmbown/CodeWhale · error

invalid model '{model}' for provider '{}'

Error message

invalid model '{model}' for provider '{}'

What it means

Error "invalid model '{model}' for provider '{}'" thrown in Hmbown/CodeWhale.

Source

Thrown at crates/tui/src/config_ui.rs:892

    if model.is_empty() {
        bail!(
            "invalid model '{model}' for provider '{}'",
            provider.as_str()
        );
    }
    if model.eq_ignore_ascii_case("auto") {
        // Still run the provider gate so empty/unknown providers cannot sneak
        // an `auto` through without the same checks as `/model auto`.
        validate_route(provider, model).map_err(anyhow::Error::msg)?;
        return Ok("auto".to_string());
    }

    // OpenCode Go is protocol-bound (Chat Completions only) even when its base
    // URL is overridden — never open the custom-endpoint passthrough for it.
    if provider == crate::config::ApiProvider::OpencodeGo {
        validate_route(provider, model).map_err(anyhow::Error::msg)?;
        return normalize_model_name_for_provider(provider, model).ok_or_else(|| {
            anyhow::anyhow!(
                "invalid model '{model}' for provider '{}'",
                provider.as_str()
            )
        });
    }

    // Custom / self-hosted endpoints own their model id namespace. Match the
    // request path (`wire_model_for_provider_route`) so saving `/config` on a
    // custom deepseek gateway does not reject a non-DeepSeek wire id the
    // session is already running.
    if config.provider_uses_custom_endpoint(provider) {
        return normalize_custom_model_id(model).ok_or_else(|| {
            anyhow::anyhow!(
                "invalid model '{model}' for provider '{}'",
                provider.as_str()
            )
        });
    }

View on GitHub (pinned to 8880682c63)

When it happens

Trigger: Thrown at crates/tui/src/config_ui.rs:892 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@8880682c63 (2026-08-16). Data as JSON: /api/errors/5e7d406809f2fac8. Report an issue: GitHub.