{"record":{"id":"204fabdf4c179b28","repo":"zed-industries/zed","slug":"delete-session-not-supported","errorCode":null,"errorMessage":"delete_session not supported","messagePattern":"delete_session not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/acp_thread/src/connection.rs","lineNumber":399,"sourceCode":"    SessionInfo {\n        session_id: acp::SessionId,\n        update: acp::SessionInfoUpdate,\n    },\n}\n\npub trait AgentSessionList {\n    fn list_sessions(\n        &self,\n        request: AgentSessionListRequest,\n        cx: &mut App,\n    ) -> Task<Result<AgentSessionListResponse>>;\n\n    fn supports_delete(&self) -> bool {\n        false\n    }\n\n    fn delete_session(&self, _session_id: &acp::SessionId, _cx: &mut App) -> Task<Result<()>> {\n        Task::ready(Err(anyhow::anyhow!(\"delete_session not supported\")))\n    }\n\n    fn delete_sessions(&self, _cx: &mut App) -> Task<Result<()>> {\n        Task::ready(Err(anyhow::anyhow!(\"delete_sessions not supported\")))\n    }\n\n    fn watch(&self, _cx: &mut App) -> Option<async_channel::Receiver<SessionListUpdate>> {\n        None\n    }\n\n    fn notify_refresh(&self) {}\n\n    fn into_any(self: Rc<Self>) -> Rc<dyn Any>;\n}\n\nimpl dyn AgentSessionList {\n    pub fn downcast<T: 'static + AgentSessionList + Sized>(self: Rc<Self>) -> Option<Rc<T>> {\n        self.into_any().downcast().ok()","sourceCodeStart":381,"sourceCodeEnd":417,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/acp_thread/src/connection.rs#L381-L417","documentation":"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.","triggerScenarios":"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.","commonSituations":"Generic UI or tooling calling delete unconditionally instead of gating on supports_delete(); new session-list implementations forgetting to override the method.","solutions":["Gate calls on supports_delete() before invoking delete_session.","Override delete_session in your AgentSessionList impl if the backend can delete sessions, and return true from supports_delete.","Hide the delete affordance in the UI when supports_delete() is false."],"exampleFix":"// before\nlist.delete_session(&session_id, cx).await?; // \"delete_session not supported\"\n\n// after\nif list.supports_delete() {\n    list.delete_session(&session_id, cx).await?;\n} else {\n    // backend cannot delete; hide the action\n}","handlingStrategy":"validation","validationCode":"if session_list.supports_delete() {\n    session_list.delete_session(&session_id, cx).await?;\n} else {\n    // hide or disable the delete action for this backend\n}","typeGuard":"fn can_delete_sessions(list: &Rc<dyn AgentSessionList>) -> bool {\n    list.supports_delete()\n}","tryCatchPattern":null,"preventionTips":["Always gate delete UI and calls on supports_delete().","When implementing AgentSessionList, override delete_session if the backend supports it."],"tags":["rust","zed","acp","trait-default","session-list","capability"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}