zed-industries/zed · error

delete_session not supported

Error message

delete_session not supported

What it means

Default implementation of AgentSessionList::delete_session in crates/acp_thread/src/connection.rs. Implementations that do not override it (and report supports_delete() == false) return this error, signalling the backend cannot delete a single session.

Source

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

    SessionInfo {
        session_id: acp::SessionId,
        update: acp::SessionInfoUpdate,
    },
}

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()

View on GitHub (pinned to bc538def45)

Solutions

  1. Gate calls on supports_delete() before invoking delete_session.
  2. Override delete_session in your AgentSessionList impl if the backend can delete sessions, and return true from supports_delete.
  3. Hide the delete affordance in the UI when supports_delete() is false.

Example fix

// before
list.delete_session(&session_id, cx).await?; // "delete_session not supported"

// after
if list.supports_delete() {
    list.delete_session(&session_id, cx).await?;
} else {
    // backend cannot delete; hide the action
}
Defensive patterns

Strategy: validation

Validate before calling

if session_list.supports_delete() {
    session_list.delete_session(&session_id, cx).await?;
} else {
    // hide or disable the delete action for this backend
}

Type guard

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

Prevention

When it happens

Trigger: Calling delete_session on an AgentSessionList implementation that did not override it, e.g. a list-only or remote backend that only implements list_sessions/watch.

Common situations: Generic UI or tooling calling delete unconditionally instead of gating on supports_delete(); new session-list implementations forgetting to override the method.

Related errors


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