zed-industries/zed · error
project entry not found
Error message
project entry not found
What it means
After resolving the directory's ProjectPath, the flow looks the entry up in the worktree snapshot via project.entry_for_path. None means the snapshot has no entry for that path yet — the background scan has not reached that subtree, the entry was deleted, or the path does not resolve to a snapshot entry (casing or unicode normalization mismatch).
Source
Thrown at crates/agent_ui/src/mention_set.rs:1255
.to_string_lossy()
.to_string(),
));
}
}
files
}
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 directory mention {abs_path:?}"
)));
};
let Some(entry) = project.read(cx).entry_for_path(&project_path, cx) else {
return Task::ready(Err(anyhow!("project entry not found")));
};
let directory_path = entry.path.clone();
let worktree_id = project_path.worktree_id;
let Some(worktree) = project.read(cx).worktree_for_id(worktree_id, cx) else {
return Task::ready(Err(anyhow!("worktree not found")));
};
let project = project.clone();
cx.spawn(async move |cx| {
let file_paths = worktree.read_with(cx, |worktree, _cx| {
collect_files_in_path(worktree, &directory_path)
});
let descendants_future = cx.update(|cx| {
futures::future::join_all(file_paths.into_iter().map(
|(worktree_path, full_path): (Arc<RelPath>, String)| {
let rel_path = worktree_path
.strip_prefix(&directory_path)
.map_or_else(|_| worktree_path.clone(), |rel_path| rel_path.into());
View on GitHub (pinned to bc538def45)
Solutions
- Wait for the worktree scan to finish (the project tree shows the directory) and retry.
- Verify the directory still exists on disk.
- Reopen or refresh the worktree if the snapshot appears stale.
Defensive patterns
Strategy: validation
Validate before calling
let entry_in_snapshot = project
.read(cx)
.entry_for_path(&project_path, cx)
.is_some();
if !entry_in_snapshot {
// wait for the worktree scan to complete before offering the directory
} Try / catch
match confirm_task.await {
Ok(mention) => { /* attach */ }
Err(err) if err.to_string() == "project entry not found" => {
show_user("Directory is not in the project snapshot yet; try again after scanning finishes")
}
Err(err) => return Err(err),
} Prevention
- Only list directories that already appear in the worktree snapshot.
- Subscribe to worktree scan-complete events and refresh the picker.
- Canonicalize paths (case and unicode form) before lookup.
When it happens
Trigger: Mentioning a directory in a freshly opened large worktree before the background scan populates that subtree; the directory being deleted between picker population and confirmation; NFC/case path differences on macOS or case-insensitive filesystems.
Common situations: Large monorepos immediately after opening; directories removed by a clean/build task while the picker is open; paths that differ only in normalization from the snapshot entry.
Related errors
- project path not found for symbol mention {abs_path:?}
- project path not found for directory mention {abs_path:?}
- worktree not found
- cannot capture writable sandbox path `{}`
- Failed to read skill file {}: {}
AI-assisted analysis of zed-industries/zed@bc538def45 (2026-08-16).
Data as JSON: /api/errors/567e5469ac95d9fe.
Report an issue: GitHub.