zed-industries/zed · error

project entry not found

Error message

project entry not found

What it means

The absolute directory was successfully mapped to a ProjectPath, but entry_for_path returned None — the worktree's current snapshot contains no entry at that path, typically because the directory was deleted, ignored, or not yet scanned when the mention was expanded in full_mention_for_directory.

Solutions

  1. Verify the directory still exists on disk and is not git-ignored by the owning worktree
  2. Wait for the worktree scan to finish (large or remote worktrees index asynchronously) and retry the mention
  3. Re-add or refresh the worktree so its snapshot includes the directory
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at crates/agent_ui/src/mention_set.rs:1255 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/567e5469ac95d9fe. Report an issue: GitHub.

Appendix: 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 f4178619ac)