{"record":{"id":"fd621f73c5351b9f","repo":"zed-industries/zed","slug":"source-workspace-is-no-longer-available","errorCode":null,"errorMessage":"Source workspace is no longer available","messagePattern":"Source workspace is no longer available","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/agent_ui/src/agent_panel.rs","lineNumber":4776,"sourceCode":"                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,\n                };\n                let action = zed_actions::CreateWorktree {\n                    worktree_name: request.worktree_name.clone(),\n                    branch_target,\n                };\n                let creation = window.update(cx, |_root, window, cx| {\n                    workspace.update(cx, |workspace, cx| {","sourceCodeStart":4758,"sourceCodeEnd":4794,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/agent_ui/src/agent_panel.rs#L4758-L4794","documentation":"Error \"Source workspace is no longer available\" thrown in zed-industries/zed.","triggerScenarios":"Thrown at crates/agent_ui/src/agent_panel.rs:4776 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"}