{"record":{"id":"b79c46d4316565f6","repo":"zed-industries/zed","slug":"no-subagent-session-found-with-id-session-id","errorCode":null,"errorMessage":"No subagent session found with id {session_id}","messagePattern":"No subagent session found with id (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/agent/src/agent.rs","lineNumber":3168,"sourceCode":"\nstruct NativeAgentSessionRetry {\n    connection: NativeAgentConnection,\n    session_id: acp::SessionId,\n}\n\nimpl acp_thread::AgentSessionRetry for NativeAgentSessionRetry {\n    fn run(&self, cx: &mut App) -> Task<Result<acp::PromptResponse>> {\n        self.connection\n            .run_turn(self.session_id.clone(), cx, |thread, cx| {\n                thread.update(cx, |thread, cx| thread.resume(cx))\n            })\n    }\n}\n\nstruct NativeAgentSessionSetTitle {\n    thread: Entity<Thread>,\n}\n\nimpl acp_thread::AgentSessionSetTitle for NativeAgentSessionSetTitle {\n    fn run(&self, title: SharedString, cx: &mut App) -> Task<Result<()>> {\n        self.thread\n            .update(cx, |thread, cx| thread.set_title(title, cx));\n        Task::ready(Ok(()))\n    }\n}\n\npub struct NativeThreadEnvironment {\n    agent: WeakEntity<NativeAgent>,\n    thread: WeakEntity<Thread>,\n    acp_thread: WeakEntity<AcpThread>,\n}\n\nimpl NativeThreadEnvironment {\n    pub(crate) fn create_subagent_thread(\n        &self,\n        label: String,","sourceCodeStart":3150,"sourceCodeEnd":3186,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/agent/src/agent.rs#L3150-L3186","documentation":"Raised in resume_subagent_thread when the agent's session map has no entry for the given acp::SessionId. The subagent session being resumed no longer exists (expired or never created), so there is no thread to hand back to the caller.","triggerScenarios":"Thrown at crates/agent/src/agent.rs:3144 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the subagent session id is valid and belongs to this agent instance","Resume the parent thread instead if the subagent session no longer exists","Re-create the subagent rather than resuming when its session was dropped (e.g. after restart)"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"916fc2b8cb3a815cbef4a3b40e13081be72036b6","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}