{"record":{"id":"3a28b8b32b10a8c0","repo":"zed-industries/zed","slug":"delete-session-not-supported-3a28b8","errorCode":null,"errorMessage":"delete_session not supported","messagePattern":"delete_session not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent_servers/src/acp.rs","lineNumber":607,"sourceCode":"                                .map(|dt| dt.with_timezone(&chrono::Utc))\n                        }),\n                        created_at: None,\n                        meta: s.meta,\n                    })\n                    .collect(),\n                next_cursor: response.next_cursor,\n                meta: response.meta,\n            })\n        })\n    }\n\n    fn supports_delete(&self) -> bool {\n        self.supports_delete\n    }\n\n    fn delete_session(&self, session_id: &acp::SessionId, cx: &mut App) -> Task<Result<()>> {\n        if !self.supports_delete() {\n            return Task::ready(Err(anyhow::anyhow!(\"delete_session not supported\")));\n        }\n\n        let conn = self.connection.clone();\n        let updates_tx = self.updates_tx.clone();\n        let session_id = session_id.clone();\n        cx.foreground_executor().spawn(async move {\n            conn.send_request(acp::DeleteSessionRequest::new(session_id))\n                .block_task()\n                .await\n                .map_err(map_acp_error)?;\n            updates_tx\n                .try_send(acp_thread::SessionListUpdate::Refresh)\n                .log_err();\n            Ok(())\n        })\n    }\n\n    fn watch(","sourceCodeStart":589,"sourceCodeEnd":625,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/agent_servers/src/acp.rs#L589-L625","documentation":"AcpAgentConnection.delete_session deletes a session server-side via an ACP DeleteSessionRequest, but only when the initialize handshake advertised that capability. The method's own guard returns this error immediately when supports_delete() is false, avoiding a protocol-level rejection from an agent that has no session/delete handling.","triggerScenarios":"delete_session invoked on a connection whose agent capabilities lack session deletion — typically a caller that does not check supports_delete() first (the guard makes the unsupported path explicit rather than relying on the caller).","commonSituations":"Third-party or custom ACP agents (claude-code/gemini bridges) built against older ACP versions; UI that shows a delete button for every registered agent regardless of capability.","solutions":["Gate delete UI and logic on connection.supports_delete() before calling delete_session","Upgrade the agent implementation so it advertises session deletion in its capabilities","Fall back to hiding the thread locally when server-side deletion is unavailable"],"exampleFix":"// before\nconnection.delete_session(&session_id, cx).await?;\n\n// after\nif connection.supports_delete() {\n    connection.delete_session(&session_id, cx).await?;\n} else {\n    hide_thread_locally(&session_id);\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"fn can_delete_sessions(connection: &AcpAgentConnection) -> bool {\n    connection.supports_delete()\n}","tryCatchPattern":"Check supports_delete() first; on the 'delete_session not supported' error fall back to local-only removal (hide the thread without a server-side RPC).","preventionTips":["Drive all delete UI from the capabilities reported in the initialize handshake","Always pair delete_session calls with a supports_delete() guard in review checklists"],"tags":["acp","agent-server","capabilities","delete-session"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}