{"record":{"id":"253939178d1240cf","repo":"zed-industries/zed","slug":"no-active-repository","errorCode":null,"errorMessage":"no active repository","messagePattern":"no active repository","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent_ui/src/mention_set.rs","lineNumber":685,"sourceCode":"                .unwrap_or_else(|| \"No diagnostics found.\".into());\n            Ok(Mention::Text {\n                content,\n                tracked_buffers: Vec::new(),\n            })\n        })\n    }\n\n    pub fn confirm_mention_for_git_diff(\n        &self,\n        base_ref: SharedString,\n        cx: &mut Context<Self>,\n    ) -> Task<Result<Mention>> {\n        let Some(project) = self.project.upgrade() else {\n            return Task::ready(Err(anyhow!(\"project not found\")));\n        };\n\n        let Some(repo) = project.read(cx).active_repository(cx) else {\n            return Task::ready(Err(anyhow!(\"no active repository\")));\n        };\n\n        let diff_receiver = repo.update(cx, |repo, cx| {\n            repo.diff(\n                git::repository::DiffType::MergeBase { base_ref: base_ref },\n                cx,\n            )\n        });\n\n        cx.spawn(async move |_, _| {\n            let diff_text = diff_receiver.await??;\n            if diff_text.is_empty() {\n                Ok(Mention::Text {\n                    content: \"No changes found in branch diff.\".into(),\n                    tracked_buffers: Vec::new(),\n                })\n            } else {\n                Ok(Mention::Text {","sourceCodeStart":667,"sourceCodeEnd":703,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/agent_ui/src/mention_set.rs#L667-L703","documentation":"Raised by confirm_mention_for_git_diff when the active project exposes no active repository, meaning there is no git repo context to compute a diff mention against; the returned Task short-circuits with this sentinel error instead of performing any git work.","triggerScenarios":"Thrown at crates/agent_ui/src/mention_set.rs:685 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure a git repository is open as the active workspace before inserting a git-diff mention","Open a folder containing a .git directory (or a multi-worktree project) so active_repository returns Some","If the project genuinely has no repo, suggest a plain text or file mention instead of a git-diff mention"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}