{"record":{"id":"8da5c8b90bd5c551","repo":"zed-industries/zed","slug":"loading-sessions-are-not-supported-by-this-agent","errorCode":null,"errorMessage":"Loading sessions are not supported by this agent.","messagePattern":"Loading sessions are not supported by this agent\\.","errorType":"exception","errorClass":"LoadError","httpStatus":null,"severity":"error","filePath":"crates/agent_servers/src/acp.rs","lineNumber":1738,"sourceCode":"    }\n\n    fn supports_session_additional_directories(&self) -> bool {\n        self.agent_capabilities\n            .session_capabilities\n            .additional_directories\n            .is_some()\n    }\n\n    fn load_session(\n        self: Rc<Self>,\n        session_id: acp::SessionId,\n        project: Entity<Project>,\n        work_dirs: PathList,\n        title: Option<SharedString>,\n        cx: &mut App,\n    ) -> Task<Result<Entity<AcpThread>>> {\n        if !self.agent_capabilities.load_session {\n            return Task::ready(Err(anyhow!(LoadError::Other(\n                \"Loading sessions is not supported by this agent.\".into()\n            ))));\n        }\n\n        let mcp_servers = mcp_servers_for_project(&project, cx);\n        self.open_or_create_session(\n            session_id,\n            project,\n            work_dirs,\n            title,\n            move |connection, session_id, directories| {\n                Box::pin(async move {\n                    let response = connection\n                        .send_request(\n                            directories.into_load_session_request(session_id.clone(), mcp_servers),\n                        )\n                        .block_task()\n                        .await","sourceCodeStart":1720,"sourceCodeEnd":1756,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/agent_servers/src/acp.rs#L1720-L1756","documentation":"load_session restores an existing conversation via ACP session/load, but only when the agent advertised loadSession in its initialize capabilities. When agent_capabilities.load_session is false, the call fails fast with LoadError::Other instead of sending an RPC the agent would reject or mishandle.","triggerScenarios":"load_session invoked on an ACP agent whose capabilities do not include load_session — stateless agents, older agent versions, or callers that skip the capability check before offering resume.","commonSituations":"Third-party ACP agents without conversation-resume support; UI that offers 'open previous thread' for every registered agent regardless of capability.","solutions":["Check agent_capabilities.load_session before offering or performing session load","Start a new session instead of loading for agents without the capability","Upgrade the agent to a build that advertises session load"],"exampleFix":"// before\nlet thread = connection.load_session(id.clone(), project, dirs, None, cx).await?;\n\n// after — fall back to a new session when resume is unsupported\nlet thread = if connection.agent_capabilities.load_session {\n    connection.load_session(id, project, dirs, None, cx).await?\n} else {\n    connection.open_session(project, dirs, cx).await?\n};","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"fn supports_session_load(connection: &AcpAgentConnection) -> bool {\n    connection.agent_capabilities.load_session\n}","tryCatchPattern":"Check agent_capabilities.load_session first; if the load fails with this error, degrade gracefully by starting a new session instead of resuming.","preventionTips":["Read capabilities from the initialize handshake and let them drive resume UI","Test third-party ACP agents for loadSession support before advertising history restore to users"],"tags":["acp","agent-server","capabilities","load-session"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}