{"record":{"id":"83f82cb073c4a903","repo":"zed-industries/zed","slug":"project-path-not-found-for-symbol-mention-abs-pat","errorCode":null,"errorMessage":"project path not found for symbol mention {abs_path:?}","messagePattern":"project path not found for symbol mention (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent_ui/src/mention_set.rs","lineNumber":475,"sourceCode":"                tracked_buffers: Vec::new(),\n            })\n        })\n    }\n\n    fn confirm_mention_for_symbol(\n        &self,\n        abs_path: PathBuf,\n        line_range: RangeInclusive<u32>,\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        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 symbol mention {abs_path:?}\"\n            )));\n        };\n        let buffer = project.update(cx, |project, cx| project.open_buffer(project_path, cx));\n        cx.spawn(async move |_, cx| {\n            let buffer = buffer.await?;\n            let mention = buffer.update(cx, |buffer, cx| {\n                let start = Point::new(*line_range.start(), 0).min(buffer.max_point());\n                let end = Point::new(*line_range.end() + 1, 0).min(buffer.max_point());\n                let content = buffer.text_for_range(start..end).collect();\n                Mention::Text {\n                    content,\n                    tracked_buffers: vec![cx.entity()],\n                }\n            });\n            Ok(mention)\n        })\n    }","sourceCodeStart":457,"sourceCodeEnd":493,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/agent_ui/src/mention_set.rs#L457-L493","documentation":"Thrown while confirming a symbol @-mention in the agent panel. Zed must translate the symbol's absolute file path into a ProjectPath (worktree id + relative path) via project_path_for_absolute_path before it can open the buffer and extract the mentioned lines. This error means no open worktree in the current project contains abs_path, so the mention cannot be attached to the conversation.","triggerScenarios":"Confirming a symbol mention when the symbol's abs_path is not under any worktree root: the file belongs to another window's project, the worktree was removed or re-rooted, the file was deleted or moved after the symbol list was built, or (on remote projects) the language server returned a path that does not map to the remote worktree.","commonSituations":"Multi-worktree or multi-window setups where the symbol comes from a project that is not open here; remote/SSH projects with path-translation mismatches; symbols in dependencies or cache directories outside the workspace; mentioning a symbol right after closing its worktree.","solutions":["Open (or re-add) the worktree that contains the file in the same project, then retry the mention.","For remote projects, verify the symbol path is inside the remote worktree and that path translation matches the worktree root shown in the project panel.","If the file was moved or deleted, restart the language server to rebuild the symbol index and mention a symbol that still exists.","As a UI developer: pre-check worktree containment and show a 'file is outside the open project' message instead of surfacing the raw error."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"fn path_in_open_worktree(project: &Entity<Project>, abs_path: &Path, cx: &App) -> bool {\n    project\n        .read(cx)\n        .worktrees(cx)\n        .any(|worktree| abs_path.starts_with(worktree.read(cx).abs_path()))\n}\n// before confirming the symbol mention:\nif !path_in_open_worktree(&project, &abs_path, cx) {\n    // hide or disable the symbol mention instead of confirming it\n}","typeGuard":null,"tryCatchPattern":"match mention_task.await {\n    Ok(mention) => { /* attach */ }\n    Err(err) if err.to_string().starts_with(\"project path not found\") => {\n        show_user(\"This file is outside the open project\")\n    }\n    Err(err) => return Err(err),\n}","preventionTips":["Only offer symbol mentions for files inside worktrees open in the same project.","Recompute mention candidates when a worktree is added to or removed from the project.","For remote projects, run symbol paths through the same path translation used for editors before offering them."],"tags":["zed","agent-ui","mentions","project-path","worktree"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}