zed-industries/zed · error

delete_sessions not supported

Error message

delete_sessions not supported

What it means

Default implementation of AgentSessionList::delete_sessions (the clear-all variant). Backends that only implement single-session deletion, or neither, return this error when asked to delete every session.

Source

Thrown at crates/acp_thread/src/connection.rs:403

}

pub trait AgentSessionList {
    fn list_sessions(
        &self,
        request: AgentSessionListRequest,
        cx: &mut App,
    ) -> Task<Result<AgentSessionListResponse>>;

    fn supports_delete(&self) -> bool {
        false
    }

    fn delete_session(&self, _session_id: &acp::SessionId, _cx: &mut App) -> Task<Result<()>> {
        Task::ready(Err(anyhow::anyhow!("delete_session not supported")))
    }

    fn delete_sessions(&self, _cx: &mut App) -> Task<Result<()>> {
        Task::ready(Err(anyhow::anyhow!("delete_sessions not supported")))
    }

    fn watch(&self, _cx: &mut App) -> Option<async_channel::Receiver<SessionListUpdate>> {
        None
    }

    fn notify_refresh(&self) {}

    fn into_any(self: Rc<Self>) -> Rc<dyn Any>;
}

impl dyn AgentSessionList {
    pub fn downcast<T: 'static + AgentSessionList + Sized>(self: Rc<Self>) -> Option<Rc<T>> {
        self.into_any().downcast().ok()
    }
}

#[derive(Debug)]

View on GitHub (pinned to bc538def45)

Solutions

  1. Gate bulk-delete calls on supports_delete() and fall back to iterating delete_session per id when the bulk method is unsupported.
  2. Override delete_sessions in your implementation if the backend can clear sessions efficiently.
  3. Disable 'delete all' UI when the capability is absent.

Example fix

// before
list.delete_sessions(cx).await?; // "delete_sessions not supported"

// after
if list.supports_delete() {
    match list.delete_sessions(cx).await {
        Err(e) if e.to_string().contains("not supported") => {
            for id in known_ids { list.delete_session(&id, cx).await?; }
        }
        result => result?,
    }
}
Defensive patterns

Strategy: validation

Validate before calling

if session_list.supports_delete() {
    // prefer bulk, fall back to per-id deletes
    let bulk = session_list.delete_sessions(cx).await;
    if bulk.is_err() {
        for id in ids { session_list.delete_session(&id, cx).await?; }
    }
}

Type guard

fn can_delete_sessions(list: &Rc<dyn AgentSessionList>) -> bool {
    list.supports_delete()
}

Prevention

When it happens

Trigger: Calling delete_sessions on an AgentSessionList impl that did not override the bulk method; a 'clear all history' action routed to a backend without bulk support.

Common situations: History-management UI assuming bulk delete exists; custom backends implementing delete_session but not delete_sessions.

Related errors


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