{"record":{"id":"b393ec3b3bacb770","repo":"openai/codex","slug":"path-must-be-a-directory","errorCode":null,"errorMessage":"path must be a directory: {}","messagePattern":"path must be a directory: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/tui/src/windows_sandbox.rs","lineNumber":108,"sourceCode":"}\n\n#[cfg(target_os = \"windows\")]\npub(crate) fn grant_read_root_non_elevated(\n    permission_profile: &PermissionProfile,\n    workspace_roots: &[AbsolutePathBuf],\n    command_cwd: &Path,\n    env_map: &HashMap<String, String>,\n    codex_home: &Path,\n    read_root: &Path,\n) -> anyhow::Result<PathBuf> {\n    if !read_root.is_absolute() {\n        anyhow::bail!(\"path must be absolute: {}\", read_root.display());\n    }\n    if !read_root.exists() {\n        anyhow::bail!(\"path does not exist: {}\", read_root.display());\n    }\n    if !read_root.is_dir() {\n        anyhow::bail!(\"path must be a directory: {}\", read_root.display());\n    }\n\n    let canonical_root = dunce::canonicalize(read_root)?;\n    codex_windows_sandbox::run_setup_refresh_with_extra_read_roots(\n        permission_profile,\n        workspace_roots,\n        command_cwd,\n        env_map,\n        codex_home,\n        vec![canonical_root.clone()],\n        /*proxy_enforced*/ false,\n    )?;\n    Ok(canonical_root)\n}\n","sourceCodeStart":90,"sourceCodeEnd":123,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/tui/src/windows_sandbox.rs#L90-L123","documentation":"Error \"path must be a directory: {}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/tui/src/windows_sandbox.rs:108 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}