zed-industries/zed · error
project path not found for file mention
Error message
project path not found for file mention {abs_path:?} What it means
Emitted by confirm_mention_for_file when project.project_path_for_absolute_path returns None for the mentioned absolute path: the file lies outside every open worktree, so it has no project path and cannot be opened as a buffer for the mention. The offending input is abs_path, which is not covered by any worktree in the current project.
Solutions
- Add the file's directory as a worktree in the project
- Mention a copy of the file that lives inside the project
- Reopen the workspace that contains the file before mentioning it
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/agent_ui/src/mention_set.rs:398 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20).
Data as JSON: /api/errors/001b800928e49333.
Report an issue: GitHub.
Appendix: source
Thrown at crates/agent_ui/src/mention_set.rs:398
}
})
}
pub fn confirm_mention_for_file(
&self,
abs_path: PathBuf,
supports_images: bool,
cx: &mut Context<Self>,
) -> Task<Result<Mention>> {
let Some(project) = self.project.upgrade() else {
return Task::ready(Err(anyhow!("project not found")));
};
let Some(project_path) = project
.read(cx)
.project_path_for_absolute_path(&abs_path, cx)
else {
return Task::ready(Err(anyhow!(
"project path not found for file mention {abs_path:?}"
)));
};
if is_raster_image_path(&abs_path) {
if !supports_images {
return Task::ready(Err(anyhow!("This model does not support images yet")));
}
let task = project.update(cx, |project, cx| project.open_image(project_path, cx));
return cx.spawn(async move |_, cx| {
let image = task.await?;
let image = image.update(cx, |image, _| image.image.clone());
let image = cx
.update(|cx| LanguageModelImage::from_image(image, cx))
.await;
if let Some(image) = image {
Ok(Mention::Image(MentionImage {
data: image.source,View on GitHub (pinned to f4178619ac)