Hmbown/CodeWhale · error

Fleet task `{}`: {reason} (source={source})

Error message

Fleet task `{}`: {reason} (source={source})

What it means

A fleet task pins a concrete model but declares no explicit provider, so the runtime must validate that model against the session/default provider (falling back to DeepSeek with its default base URL when no config exists). `validate_unpinned_model_provider` rejected the combination, and this bail wraps its reason with the task id and the `source` that pinned the model. In short: the provider that would have to serve this model cannot.

Source

Thrown at crates/tui/src/fleet/worker_runtime.rs:92

        let agent_profile = resolve_task_agent_profile(task, agent_profiles)
            .ok()
            .flatten();
        let (model, source) =
            effective_fleet_model_with_source(run_model, task.worker.as_ref(), agent_profile);
        let pinned_model = matches!(source, "task.model" | "agent_profile.model");
        let explicit_provider = explicit_fleet_provider_id(agent_profile);
        if pinned_model && explicit_provider.is_none() {
            let (provider, base_url) = config.map_or_else(
                || {
                    let provider = ApiProvider::Deepseek;
                    (provider, provider.default_base_url().to_string())
                },
                |config| (config.api_provider(), config.deepseek_base_url()),
            );
            if let Err(reason) =
                crate::route_runtime::validate_unpinned_model_provider(provider, &model, &base_url)
            {
                bail!("Fleet task `{}`: {reason} (source={source})", task.id);
            }
        }

        let route = resolve_fleet_route_with_config(task, agent_profiles, session_model, config);
        if route.is_some() {
            validate_fleet_reasoning_effort(task, agent_profiles, session_model, config)?;
        }
        if !pinned_model {
            continue;
        }
        // A concrete model is pinned at the task/profile level; it must resolve
        // to a real provider route or the worker cannot launch.
        if route.is_some() {
            continue;
        }
        let provider = explicit_provider
            .map(|provider| format!("provider=`{provider}`"))
            .unwrap_or_else(|| {

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Set an explicit provider for that model in the agent profile the task references, so validation no longer runs against the session/default provider.
  2. Switch the task's model role to `inherit` so it uses the session model instead of a pin.
  3. Fix the model id or the provider config (base_url, credentials) so the session/default provider actually serves the pinned model.
  4. Read the embedded `{reason}` and `{source}`: the reason says what the provider check rejected, the source says whether the pin came from the task or the profile.

Example fix

# before (agent profile TOML)
id = "implementer"
model = "claude-sonnet-4"
# no provider declared

# after
id = "implementer"
provider = "anthropic"
model = "claude-sonnet-4"
Defensive patterns

Strategy: validation

Validate before calling

// Before launching the fleet, ensure every pinned model is servable by the
// provider that will resolve it: either the profile sets an explicit provider,
// or the model must exist on the session/default provider.
fn profile_pins_are_servable(tasks: &[FleetTaskSpec], profiles: &[AgentProfile], session_model: &str) -> bool {
    tasks.iter().all(|t| {
        let pinned = effective_model(t, profiles);
        pinned.is_none() || pinned.as_deref() == Some(session_model) || has_explicit_provider(t, profiles)
    })
}

Try / catch

match run_fleet_launch(&spec) {
    Err(e) if e.to_string().contains("Fleet task `") && e.to_string().contains("source=") => {
        // provider/model mismatch: read {reason} and {source}, fix profile or switch role to inherit
        report_route_misconfiguration(e);
    }
    other => other,
}

Prevention

When it happens

Trigger: A task whose worker profile pins `model = "claude-..."` (or any model not served by the active provider) with no `agent_profile` that sets an explicit provider; running on a machine whose session provider is DeepSeek or whose config points at a base_url/gateway that does not expose that model id.

Common situations: Copying a fleet spec from a teammate with a different default provider; removing or renaming a provider config so the fallback Deepseek route no longer matches; pointing deepseek_base_url at a proxy whose model catalog differs from the official API.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/ceae8b99c143385f. Report an issue: GitHub.