Hmbown/CodeWhale · error

model cannot be empty

Error message

model cannot be empty

What it means

Error "model cannot be empty" thrown in Hmbown/CodeWhale.

Source

Thrown at crates/tui/src/config.rs:11177

            "config_path": config_path.display().to_string(),
        }),
    );
    codewhale_config::scrub_plaintext_api_keys_from_config_backup(&config_path)?;

    Ok(SavedCredential::ConfigFile(config_path))
}

/// Persist a default model for `provider` via the comment-preserving config
/// path used by guided provider setup (#3875). DeepSeek writes root
/// `default_text_model`; other hosted providers write `[providers.<name>] model`.
pub(crate) fn save_provider_model_for_identity(
    identity: &ProviderIdentity,
    _route_config: &Config,
    model: &str,
) -> Result<PathBuf> {
    let provider = identity.provider;
    let model = model.trim();
    anyhow::ensure!(!model.is_empty(), "model cannot be empty");

    let config_path =
        try_default_config_path().context("Failed to resolve config path for provider model.")?;
    ensure_parent_dir(&config_path)?;

    let is_legacy_literal_custom = provider == ApiProvider::Custom
        && identity.key.trim() == ApiProvider::Custom.as_str()
        && identity.persisted_id().is_none();
    if matches!(provider, ApiProvider::Deepseek | ApiProvider::DeepseekCN)
        || is_legacy_literal_custom
    {
        crate::config_persistence::mutate_config_document(&config_path, |doc| {
            crate::config_persistence::set_document_value(doc, &["default_text_model"], model)
        })
        .with_context(|| format!("Failed to write config to {}", config_path.display()))?;
        return Ok(config_path);
    }

View on GitHub (pinned to 8880682c63)

When it happens

Trigger: Thrown at crates/tui/src/config.rs:11177 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/836b065195dac1fd. Report an issue: GitHub.