{"record":{"id":"66dc2ab49fb4a517","repo":"zed-industries/zed","slug":"project-path-not-found-for-directory-mention-abs","errorCode":null,"errorMessage":"project path not found for directory mention {abs_path:?}","messagePattern":"project path not found for directory mention (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent_ui/src/mention_set.rs","lineNumber":1250,"sourceCode":"            } else if entry.is_file() {\n                files.push((\n                    entry.path.clone(),\n                    worktree\n                        .full_path(&entry.path)\n                        .to_string_lossy()\n                        .to_string(),\n                ));\n            }\n        }\n\n        files\n    }\n\n    let Some(project_path) = project\n        .read(cx)\n        .project_path_for_absolute_path(&abs_path, cx)\n    else {\n        return Task::ready(Err(anyhow!(\n            \"project path not found for directory mention {abs_path:?}\"\n        )));\n    };\n    let Some(entry) = project.read(cx).entry_for_path(&project_path, cx) else {\n        return Task::ready(Err(anyhow!(\"project entry not found\")));\n    };\n    let directory_path = entry.path.clone();\n    let worktree_id = project_path.worktree_id;\n    let Some(worktree) = project.read(cx).worktree_for_id(worktree_id, cx) else {\n        return Task::ready(Err(anyhow!(\"worktree not found\")));\n    };\n    let project = project.clone();\n    cx.spawn(async move |cx| {\n        let file_paths = worktree.read_with(cx, |worktree, _cx| {\n            collect_files_in_path(worktree, &directory_path)\n        });\n        let descendants_future = cx.update(|cx| {\n            futures::future::join_all(file_paths.into_iter().map(","sourceCodeStart":1232,"sourceCodeEnd":1268,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/agent_ui/src/mention_set.rs#L1232-L1268","documentation":"In full_mention_for_directory, the user-supplied absolute directory path could not be mapped to any worktree inside the current project via project_path_for_absolute_path; the directory lies outside all open worktrees (or the worktree scan has not completed), so the directory mention cannot be resolved and the task fails immediately.","triggerScenarios":"Thrown at crates/agent_ui/src/mention_set.rs:1250 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the directory's parent folder to the project as a worktree and retry the mention","Use a path that lives inside one of the currently open worktrees","If the path refers to a deleted/renamed directory, re-index or wait for the worktree snapshot to update before mentioning it"],"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"}