zeroclaw-labs/zeroclaw · error · anyhow::Error

No configured model_providers to probe — run `zeroclaw quick

Error message

No configured model_providers to probe — run `zeroclaw quickstart` to set one up first

What it means

run_models (the doctor model-catalog probe) builds its target list from the configured model_providers and any provider override. An empty target list means no [model_providers.<alias>] entries exist at all, so there is nothing to probe and the command aborts with a pointer to zeroclaw quickstart.

Source

Thrown at crates/zeroclaw-runtime/src/doctor/mod.rs:532

    tmp.write_all(json.as_bytes())
        .context("Failed to write model cache temp file")?;
    tmp.persist(&cache_path)
        .map_err(|e| e.error)
        .context("Failed to rename model cache temp file")?;

    Ok(())
}

pub async fn run_models(
    config: &Config,
    provider_override: Option<&str>,
    _use_cache: bool,
    show_model_names: bool,
) -> Result<()> {
    let targets = doctor_model_targets(config, provider_override);

    if targets.is_empty() {
        anyhow::bail!(
            "No configured model_providers to probe — run `zeroclaw quickstart` to set one up first"
        );
    }

    println!("🩺 ZeroClaw Doctor — Model Catalog Probe");
    println!("  Providers to probe: {}", targets.len());
    println!();

    let mut ok_count = 0usize;
    let mut skipped_count = 0usize;
    let mut auth_count = 0usize;
    let mut error_count = 0usize;
    let mut matrix_rows: Vec<(String, ModelProbeOutcome, Option<usize>, String)> = Vec::new();

    for provider_name in &targets {
        println!("  [{}]", provider_name);

        let outcome = fetch_provider_catalog(config, provider_name).await;

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Run zeroclaw quickstart to configure a first model provider
  2. Or add a [model_providers.<alias>] block with model, uri, and api_key to zeroclaw.toml
  3. Re-run the doctor models probe

Example fix

# zeroclaw.toml — before
# (no model_providers section)

# after
[model_providers.openai]
model = "gpt-4o"
uri = "https://api.openai.com/v1"
api_key = "sk-..."
Defensive patterns

Strategy: validation

Validate before calling

if config.providers.models.is_empty() {
    anyhow::bail!("no model_providers configured — run `zeroclaw quickstart` first");
}
zeroclaw_runtime::doctor::run_models(&config, None, false, false).await?;

Type guard

fn has_model_providers(config: &zeroclaw_config::schema::Config) -> bool {
    !config.providers.models.is_empty()
}

Try / catch

if let Err(err) = zeroclaw_runtime::doctor::run_models(&config, override.as_deref(), false, false).await {
    if err.to_string().contains("No configured model_providers") {
        eprintln!("nothing to probe — run `zeroclaw quickstart` or add [model_providers.<alias>]");
        return Ok(());
    }
    return Err(err);
}

Prevention

When it happens

Trigger: Running the doctor models probe on a fresh install before any [model_providers.<alias>] entry exists; pointing the CLI at an empty or new config/data dir; a provider override that is blank after trimming.

Common situations: First run after install; new workspace or CI container with no config migrated yet; tests exercising probe behavior against an empty Config.

Related errors


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/ce3d4725f2b6e27b. Report an issue: GitHub.