{"record":{"id":"3fc7841af5fedffe","repo":"openai/codex","slug":"createprocessw-in-cwd-failed","errorCode":null,"errorMessage":"CreateProcessW `{:?}` in cwd `{:?}` failed: {}","messagePattern":"CreateProcessW `(.+?)` in cwd `(.+?)` failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/utils/pty/src/win/psuedocon.rs","lineNumber":211,"sourceCode":"                ptr::null_mut(),\n                0,\n                EXTENDED_STARTUPINFO_PRESENT | CREATE_UNICODE_ENVIRONMENT,\n                env_block.as_mut_ptr() as *mut _,\n                cwd.as_ref().map_or(ptr::null(), std::vec::Vec::as_ptr),\n                &mut si.StartupInfo,\n                &mut pi,\n            )\n        };\n        if res == 0 {\n            let err = IoError::last_os_error();\n            let msg = format!(\n                \"CreateProcessW `{:?}` in cwd `{:?}` failed: {}\",\n                cmd_os,\n                cwd.as_ref().map(|c| OsString::from_wide(c)),\n                err\n            );\n            log::error!(\"{msg}\");\n            bail!(\"{msg}\");\n        }\n\n        let _main_thread = unsafe { OwnedHandle::from_raw_handle(pi.hThread as _) };\n        let proc = unsafe { OwnedHandle::from_raw_handle(pi.hProcess as _) };\n\n        Ok(WinChild::new(proc, job))\n    }\n}\n\nfn resolve_current_directory(cmd: &CommandBuilder) -> Option<Vec<u16>> {\n    let home = cmd\n        .get_env(\"USERPROFILE\")\n        .and_then(|path| Path::new(path).is_dir().then(|| path.to_owned()));\n    let cwd = cmd\n        .get_cwd()\n        .and_then(|path| Path::new(path).is_dir().then(|| path.to_owned()));\n    let dir = cwd.or(home)?;\n","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/utils/pty/src/win/psuedocon.rs#L193-L229","documentation":"Error \"CreateProcessW `{:?}` in cwd `{:?}` failed: {}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/utils/pty/src/win/psuedocon.rs:211 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"}