{"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":1082,"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":1064,"sourceCodeEnd":1100,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/mcp.rs#L1064-L1100","documentation":"On Windows, bind_cwd opens the reviewed plugin's working directory without write/delete sharing and inspects its attributes. This error is thrown when the path is not a real directory or is a reparse point (symlink, junction, mount point). A reparse-point cwd could redirect the child process to an unreviewed location, so the launch is refused.","triggerScenarios":"bind_cwd (called from prepare_stdio_launch) bails when metadata.is_dir() is false or FILE_ATTRIBUTE_REPARSE_POINT (0x0000_0400) is set on the cwd handle. Only occurs on Windows.","commonSituations":"The configured cwd is a symlink or junction created for convenience; the plugin directory was replaced by a mount or OneDrive/Dropbox placeholder; a typo made the cwd point to a file.","solutions":["Replace the symlink/junction with the real directory path in the plugin's cwd configuration","Re-review the plugin pointing at the physical directory, if the reparse point is legitimate in your environment","Verify the configured cwd exists and is a plain directory (dir /a shows reparse attributes)"],"exampleFix":"// before\n\"cwd\": \"C:\\\\plugins\\\\link-to-myplugin\"  // junction → reparse point\n// after\n\"cwd\": \"C:\\\\plugins\\\\myplugin\"  // real directory","handlingStrategy":"validation","validationCode":"# PowerShell: check the configured cwd before launch\n$p = Get-Item 'C:\\plugins\\myplugin' -Force\nif ($p.Attributes -band [IO.FileAttributes]::ReparsePoint) { throw 'cwd is a reparse point' }\nif (-not $p.PSIsContainer) { throw 'cwd is not a directory' }","typeGuard":null,"tryCatchPattern":"let launch = std::process::Command::new(exe).current_dir(&cwd).spawn();\nif let Err(e) = launch {\n    if e.to_string().contains(\"reparse point or non-directory\") {\n        eprintln!(\"Resolve the cwd to a real directory (no symlinks/junctions) and retry.\");\n    }\n}","preventionTips":["Configure plugin cwd as the physical directory path, never a symlink or junction","Avoid OneDrive/Dropbox-synced folders for plugin dirs (cloud placeholders are reparse points)","Validate cwd with a reparse-point check in your deployment script"],"tags":["windows","filesystem","symlink","security","mcp"],"backgroundTag":"path-is-not-a-directory","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}