zeroclaw-labs/zeroclaw · warning · DiagItem

model route "{}" has empty model

Error message

model route "{}" has empty model

What it means

check_config_semantics flags a model route whose `model` field is empty. Even when the route's provider resolves, an empty model leaves the route unable to produce a usable model name, so any request it matches will fail downstream.

Source

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

        items.push(DiagItem::error(cat, "gateway port is 0 (invalid)"));
    }

    // Model routes validation
    for route in &config.model_routes {
        if route.hint.is_empty() {
            items.push(DiagItem::warn(cat, "model route with empty hint"));
        }
        if let Some(reason) = provider_validation_error(config, &route.model_provider) {
            items.push(DiagItem::warn(
                cat,
                format!(
                    "model route \"{}\" uses invalid model_provider \"{}\": {}",
                    route.hint, route.model_provider, reason
                ),
            ));
        }
        if route.model.is_empty() {
            items.push(DiagItem::warn(
                cat,
                format!("model route \"{}\" has empty model", route.hint),
            ));
        }
    }

    // Embedding routes validation
    for route in &config.embedding_routes {
        if route.hint.trim().is_empty() {
            items.push(DiagItem::warn(cat, "embedding route with empty hint"));
        }
        if let Some(reason) = embedding_provider_validation_error(&route.model_provider) {
            items.push(DiagItem::warn(
                cat,
                format!(
                    "embedding route \"{}\" uses invalid model_provider \"{}\": {}",
                    route.hint, route.model_provider, reason
                ),

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Set the route's `model` to a concrete model name
  2. Remove the route if it is unused
  3. Re-run `zeroclaw doctor` to confirm no route warnings remain

Example fix

# before
[[model_routes]]
hint = "cheap"
model = ""

# after
[[model_routes]]
hint = "cheap"
model = "gpt-4o-mini"
Defensive patterns

Strategy: validation

Validate before calling

fn validate_model_routes(cfg: &Config) -> Vec<String> {
    cfg.model_routes
        .iter()
        .filter(|r| r.model.is_empty())
        .map(|r| format!("route '{}' has empty model", r.hint))
        .collect()
}

Prevention

When it happens

Trigger: A `[[model_routes]]` entry with `model = ""` or the field missing; doctor prints `model route "<hint>" has empty model`.

Common situations: Routes sketched with hint/provider first and the model never filled in; fields lost during config merges.

Related errors


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