zed-industries/zed · error

No models available

Error message

No models available

What it means

NativeAgentModelSelector::list_models clones the cached model_list from the agent's models registry; if it is empty the call fails with 'No models available'. The list is populated from configured providers, so emptiness means no language models were configured or enumerated in this agent process.

Source

Thrown at crates/agent/src/agent.rs:2401

    let Some(rest) = trimmed_start.strip_prefix('/') else {
        return text.to_string();
    };
    rest.split_once(char::is_whitespace)
        .map(|(_, after)| after.to_string())
        .unwrap_or_default()
}

struct NativeAgentModelSelector {
    session_id: acp::SessionId,
    connection: NativeAgentConnection,
}

impl acp_thread::AgentModelSelector for NativeAgentModelSelector {
    fn list_models(&self, cx: &mut App) -> Task<Result<acp_thread::AgentModelList>> {
        log::debug!("NativeAgentConnection::list_models called");
        let list = self.connection.0.read(cx).models.model_list.clone();
        Task::ready(if list.is_empty() {
            Err(anyhow::anyhow!("No models available"))
        } else {
            Ok(list)
        })
    }

    fn select_model(&self, model_id: AgentModelId, cx: &mut App) -> Task<Result<()>> {
        log::debug!(
            "Setting model for session {}: {}",
            self.session_id,
            model_id
        );
        let Some(thread) = self
            .connection
            .0
            .read(cx)
            .sessions
            .get(&self.session_id)
            .map(|session| session.thread.clone())

View on GitHub (pinned to bc538def45)

Solutions

  1. Configure at least one language model provider credential in settings and retry
  2. Verify the model list actually populated (agent settings) before invoking selection
  3. If credentials exist, check provider logs for enumeration/auth failures
Defensive patterns

Strategy: validation

Validate before calling

// Check the model registry before opening selection
let list = connection.0.read(cx).models.model_list.clone();
if list.is_empty() {
    show_setup_notice("configure a provider credential first");
    return;
}

Type guard

fn has_models(agent: &AgentConnection, cx: &App) -> bool {
    !agent.0.read(cx).models.model_list.is_empty()
}

Try / catch

match selector.list_models(cx).await {
    Err(error) if error.to_string() == "No models available" => {
        open_provider_settings(); // guide the user to configure credentials
        Ok(Default::default())
    }
    other => other,
}

Prevention

When it happens

Trigger: Opening model selection before any provider is configured, before credentials have loaded/enumerated, or when every provider failed to authenticate so the registry stayed empty.

Common situations: Fresh install with no API keys; provider credentials expired so model enumeration failed; settings reference providers that are not installed/enabled; selection invoked before the registry finished its initial load.

Related errors


AI-assisted analysis of zed-industries/zed@bc538def45 (2026-08-16). Data as JSON: /api/errors/7ec32bb5a05e1d6b. Report an issue: GitHub.