{"record":{"id":"4661159d77ae7f81","repo":"Hmbown/CodeWhale","slug":"reviewed-plugin-cwd-is-a-reparse-point-or-non-dire","errorCode":null,"errorMessage":"reviewed plugin cwd is a reparse point or non-directory","messagePattern":"reviewed plugin cwd is a reparse point or non-directory","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/mcp.rs","lineNumber":967,"sourceCode":"                .open(cwd)\n                .context(\"open reviewed plugin cwd without following links\")?;\n            self.cwd_fd = Some(file);\n            self.cwd = None;\n        }\n        #[cfg(windows)]\n        {\n            use std::os::windows::fs::{MetadataExt as _, OpenOptionsExt as _};\n            let file = fs::OpenOptions::new()\n                .read(true)\n                .share_mode(0x0000_0001) // FILE_SHARE_READ only\n                .custom_flags(0x0220_0000) // BACKUP_SEMANTICS | OPEN_REPARSE_POINT\n                .open(cwd)\n                .context(\"open reviewed plugin cwd without write/delete sharing\")?;\n            let metadata = file\n                .metadata()\n                .context(\"inspect reviewed plugin cwd handle\")?;\n            if !metadata.is_dir() || metadata.file_attributes() & 0x0000_0400 != 0 {\n                anyhow::bail!(\"reviewed plugin cwd is a reparse point or non-directory\");\n            }\n            self.opened_files.push(file);\n        }\n        Ok(())\n    }\n}\n\n#[cfg(unix)]\nfn open_reviewed_launch_file(path: &Path) -> Result<fs::File> {\n    crate::plugins::manifest::open_bundle_file(path)\n        .context(\"open reviewed launch file without following links\")\n}\n\n#[cfg(windows)]\nfn open_reviewed_launch_file(path: &Path) -> Result<fs::File> {\n    crate::plugins::manifest::open_bundle_file(path)\n        .context(\"open reviewed launch file without links, hard links, or write/delete sharing\")\n}","sourceCodeStart":949,"sourceCodeEnd":985,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/mcp.rs#L949-L985","documentation":"On Windows, bind_cwd opens the plugin's configured working directory with FILE_SHARE_READ only plus BACKUP_SEMANTICS|OPEN_REPARSE_POINT, then requires the handle metadata to be a directory without FILE_ATTRIBUTE_REPARSE_POINT (0x400) (crates/tui/src/mcp.rs:956-968). This error fires when cwd is a symlink/junction/mount point or not a directory at all: the launcher refuses to pin trust to a path that can be redirected.","triggerScenarios":"plugin.toml cwd resolves to an NTFS junction or directory symlink, or cwd names a file/leftover path instead of a real directory.","commonSituations":"Home-directory junctions created by Dropbox/OneDrive redirection; manifests ported from macOS/Linux setups that used symlinks; WSL/Windows path mixups where cwd points at a file.","solutions":["Point cwd at a plain real directory: locate the reparse point with `dir /AL` or `fsutil reparsepoint query <dir>` and replace the junction path with the physical target path.","If a junction is required by your environment, materialize a real directory at the manifest's cwd and move the contents there.","After editing the manifest, run /plugin reload and re-run /plugin trust so the new paths enter the receipt.","Verify with PowerShell: (Get-Item <dir>).LinkType must be empty and Attributes must include Directory but not ReparsePoint."],"exampleFix":"# before: cwd is a junction -> reviewed plugin cwd is a reparse point or non-directory\n[mcp.server]\ncwd = \"C:\\Users\\me\\Dropbox\\plugins\\demo\"\n# after: physical directory, no reparse point\n[mcp.server]\ncwd = \"D:\\work\\plugins\\demo\"","handlingStrategy":"validation","validationCode":"#[cfg(windows)]\nfn cwd_is_plain_dir(cwd: &std::path::Path) -> bool {\n    use std::os::windows::fs::MetadataExt;\n    match std::fs::symlink_metadata(cwd) {\n        Ok(md) => md.is_dir() && md.file_attributes() & 0x0000_0400 == 0,\n        Err(_) => false,\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep plugin cwd on a physical directory, never on a junction/symlink.","Check (Get-Item <dir>).LinkType is empty before trusting a plugin on Windows.","Exclude the plugins directory from OneDrive/Dropbox junction redirection."],"tags":["windows","plugin","reparse-point","filesystem","mcp"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}