{"record":{"id":"14dade1f18e1e86c","repo":"zed-industries/zed","slug":"failed-to-convert-to-absolute-path","errorCode":null,"errorMessage":"Failed to convert {} to absolute path","messagePattern":"Failed to convert (.+?) to absolute path","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent/src/tools/read_file_tool.rs","lineNumber":298,"sourceCode":"            let (project_path, symlink_canonical_target) =\n                project.read_with(cx, |project, cx| {\n                    let resolved =\n                        resolve_project_path(project, &input.path, &canonical_roots, cx)?;\n                    anyhow::Ok(match resolved {\n                        ResolvedProjectPath::Safe(path) => (path, None),\n                        ResolvedProjectPath::SymlinkEscape {\n                            project_path,\n                            canonical_target,\n                        } => (project_path, Some(canonical_target)),\n                    })\n                }).map_err(tool_content_err)?;\n\n            let abs_path = project\n                .read_with(cx, |project, cx| {\n                    project.absolute_path(&project_path, cx)\n                })\n                .ok_or_else(|| {\n                    anyhow!(\"Failed to convert {} to absolute path\", input.path)\n                }).map_err(tool_content_err)?;\n\n            // Check settings exclusions synchronously\n            project.read_with(cx, |_project, cx| {\n                let global_settings = WorktreeSettings::get_global(cx);\n                if global_settings.is_path_excluded(&project_path.path) {\n                    anyhow::bail!(\n                        \"Cannot read file because its path matches the global `file_scan_exclusions` setting: {}\",\n                        input.path\n                    );\n                }\n\n                if global_settings.is_path_private(&project_path.path) {\n                    anyhow::bail!(\n                        \"Cannot read file because its path matches the global `private_files` setting: {}\",\n                        input.path\n                    );\n                }","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/agent/src/tools/read_file_tool.rs#L280-L316","documentation":"Raised in the read_file tool's run handler when the path returned by resolve_project_path cannot be converted from a project-relative Path into an absolute filesystem path. The input path resolved against the worktree but the resulting combination could not be produced as an absolute path, typically because the underlying worktree root is missing or the joined path is malformed.","triggerScenarios":"Thrown at crates/agent/src/tools/read_file_tool.rs:298 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the input path is a valid relative path inside an open worktree","Ensure the project still contains the worktree the path belongs to before invoking the tool","Retry with an unambiguous relative path from the worktree root"],"exampleFix":null,"handlingStrategy":"validation","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"}