zed-industries/zed · error

Unknown agent id . Call `list_agents_and_models` to see the…

Error message

Unknown agent id {id:?}. Call `list_agents_and_models` to see the agents available for `create_thread`.

What it means

create_thread with an explicit agent_id that isn't the native agent id and isn't in the panel's known agents; rejected up front so the model gets a structured error pointing at list_agents_and_models.

Solutions

  1. Call list_agents_and_models to enumerate valid agent ids
  2. Use the exact agent id returned by list_agents_and_models
  3. Omit agent_id to use the default agent when creating the thread
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/agent_ui/src/agent_panel.rs:4738 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@916fc2b8cb (2026-08-20). Data as JSON: /api/errors/8d8f628aa654740b. Report an issue: GitHub.

Appendix: source

Thrown at crates/agent_ui/src/agent_panel.rs:4765

) {
    let Some(selected) = parse_provider_slash_model(model_id) else {
        log::warn!(
            "create_thread: could not parse model override {model_id:?}; expected `provider/model-id`"
        );
        return;
    };
    let configured = LanguageModelRegistry::global(cx)
        .update(cx, |registry, cx| registry.select_model(&selected, cx));
    let Some(configured) = configured else {
        log::warn!(
            "create_thread: no model registered for {model_id:?}; using thread's default model"
        );
        return;
    };
    thread.update(cx, |thread, cx| {
        thread.set_model(configured.model, cx);
    });
}

fn parse_provider_slash_model(input: &str) -> Option<language_model::SelectedModel> {
    let (provider, model) = input.split_once('/')?;
    if provider.is_empty() || model.is_empty() {
        return None;
    }
    Some(language_model::SelectedModel {
        provider: language_model::LanguageModelProviderId::from(provider.to_string()),
        model: language_model::LanguageModelId::from(model.to_string()),
    })
}

/// Bridges agent-side `SiblingThreadHost` calls to `AgentPanel`. Constructed
/// and installed on a `NativeAgent` by the agent panel when a native-agent
/// thread is created.
pub(crate) struct AgentPanelSiblingHost {
    panel: WeakEntity<AgentPanel>,
    window: gpui::AnyWindowHandle,

View on GitHub (pinned to 916fc2b8cb)