{"record":{"id":"75efd48228a8e8a9","repo":"zed-industries/zed","slug":"agent-panel-is-no-longer-available","errorCode":null,"errorMessage":"Agent panel is no longer available","messagePattern":"Agent panel is no longer available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent_ui/src/agent_panel.rs","lineNumber":4894,"sourceCode":"                        git_ui_core::worktree_service::create_worktree_workspace(\n                            workspace, &action, window, None, cx,\n                        )\n                    })\n                })?;\n                let created = creation\n                    .await\n                    .context(\"failed to create worktree workspace\")?;\n                // The creation flow tells us when the project had multiple\n                // worktrees of the same underlying repo, which it consolidates\n                // into one new worktree — flag it so the calling agent knows\n                // the result may not reflect every source worktree's state.\n                if created.consolidated_worktrees {\n                    worktree_warning = Some(\n                        \"The project contained multiple worktrees backed by the same git \\\n                         repository, so they were consolidated into a single new worktree. \\\n                         The new thread's worktree is based on one of them and may not \\\n                         reflect the exact state of the others.\"\n                            .to_string(),\n                    );\n                }\n                // Locate the agent panel on the new workspace. We rely on\n                // the panel having registered by the time\n                // `create_worktree_workspace` returns — `open_worktree_workspace`\n                // explicitly awaits `take_panels_task` and the initial scan.\n                created\n                    .workspace\n                    .read_with(cx, |workspace, cx| workspace.panel::<AgentPanel>(cx))\n                    .ok_or_else(|| anyhow!(\"new workspace did not register an agent panel\"))?\n                    .downgrade()\n            } else {\n                panel.clone()\n            };\n            // Both the source panel and any newly-opened worktree workspace\n            // live in the same OS window (the new workspace is a tab on the\n            // existing MultiWorkspace), so the original window handle is\n            // still the right context for the `create_thread_with_options`","sourceCodeStart":4876,"sourceCodeEnd":4912,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/agent_ui/src/agent_panel.rs#L4876-L4912","documentation":"Raised in list_available_agents when the stored WeakEntity handle to the agent panel can no longer be upgraded — the panel entity was dropped before the request was served. This is a lifecycle sentinel for a stale handle: the panel (and typically its workspace) is gone, so agent enumeration cannot proceed. The fault is the dropped panel entity, not the request itself.","triggerScenarios":"Thrown at crates/agent_ui/src/agent_panel.rs:4867 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the request from a context where the agent panel is still open","Reopen the agent panel before calling list_agents_and_models"],"exampleFix":null,"handlingStrategy":"fallback","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"}