zed-industries/zed · error · anyhow::Error

delete_sessions not supported

Error message

delete_sessions not supported

What it means

Default trait-method error for AgentSessionList::delete_sessions (bulk delete). Like delete_session, the base implementation is a sentinel returning Err because the default supports_delete() is false; only agents implementing bulk deletion override it.

Solutions

  1. Gate bulk-delete UI/actions on supports_delete() returning true
  2. Delete sessions individually via an overridden delete_session if the agent supports single deletes only
  3. Implement delete_sessions in the concrete AgentSessionList to add support
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at crates/acp_thread/src/connection.rs:403 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: 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 f4178619ac)