{"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":null,"httpStatus":null,"severity":"error","filePath":"crates/agent_ui/src/agent_panel.rs","lineNumber":4850,"sourceCode":"                    request.prompt.clone(),\n                ))],\n                auto_submit: true,\n            };\n\n            let title: SharedString = request.title.clone();\n            let options = CreateThreadOptions {\n                title: Some(title.clone()),\n                initial_content: Some(initial_content),\n                agent: agent_choice.clone(),\n                model: request.model.clone(),\n                work_dirs: None,\n            };\n\n            // If the caller asked for a fresh worktree, open a new workspace\n            // backed by a linked git worktree of each git repo in the parent\n            // project — the same flow the user gets when they pick \"Create\n            // worktree\" from the worktree picker. The sibling thread is then\n            // created inside the new workspace's agent panel, so it lives\n            // alongside any threads the user would create there manually.\n            let mut worktree_warning: Option<String> = None;\n            let target_panel = if request.use_new_worktree {\n                let workspace = panel.read_with(cx, |panel, _cx| panel.workspace.clone())?;\n                let workspace = workspace\n                    .upgrade()\n                    .ok_or_else(|| anyhow!(\"Source workspace is no longer available\"))?;\n                // The branch target follows the existing UI semantics: when\n                // `base_ref` is set, treat it as the ref to base off of\n                // (resolved like `git switch --detach <ref>`); otherwise base\n                // off the current HEAD. Either way the new worktrees are in\n                // detached HEAD state — the agent can attach to a branch via\n                // git afterwards.\n                let branch_target = match request.base_ref.as_ref() {\n                    Some(ref_name) => zed_actions::NewWorktreeBranchTarget::ExistingBranch {\n                        name: ref_name.clone(),\n                    },\n                    None => zed_actions::NewWorktreeBranchTarget::CurrentBranch,","sourceCodeStart":4832,"sourceCodeEnd":4868,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/agent_ui/src/agent_panel.rs#L4832-L4868","documentation":"Emitted after a new workspace window was opened for a sibling thread's fresh worktree: the new workspace's pane tree never yielded an Agent panel, so the thread cannot be created there. This is an internal invariant check on the just-opened workspace — the panel registration either raced with the lookup or the workspace opened without an agent panel; the faulting condition is the missing panel in the new window, not user input.","triggerScenarios":"Thrown at crates/agent_ui/src/agent_panel.rs:4823 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the agent panel is enabled/visible in the new workspace window","Retry the request after the new workspace finishes opening its panels","Report the issue if a freshly opened workspace consistently lacks an agent panel"],"exampleFix":null,"handlingStrategy":"validation","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"}