{"record":{"id":"01fefc3bcd18aa82","repo":"zed-industries/zed","slug":"new-workspace-did-not-register-an-agent-panel","errorCode":null,"errorMessage":"new workspace did not register an agent panel","messagePattern":"new workspace did not register an agent panel","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/agent_ui/src/agent_panel.rs","lineNumber":4823,"sourceCode":"                // 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`\n            // call regardless of which panel ends up the target.\n            let target_window = window;\n\n            // We deliberately don't wait for the new thread's session to\n            // become available here: there are currently no agent tools that\n            // operate on sibling threads by session ID, so requiring one would\n            // just introduce a race for no benefit.\n            let resolved_agent_id = target_window.update(cx, |_root, window, cx| {\n                target_panel.update(cx, |panel, cx| {\n                    panel.create_thread_with_options(","sourceCodeStart":4805,"sourceCodeEnd":4841,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/agent_ui/src/agent_panel.rs#L4805-L4841","documentation":"Error \"new workspace did not register an agent panel\" thrown in zed-industries/zed.","triggerScenarios":"Thrown at crates/agent_ui/src/agent_panel.rs:4823 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}