{"record":{"id":"0eb186d389df4ad0","repo":"openai/codex","slug":"missing-program-for-pty-spawn","errorCode":null,"errorMessage":"missing program for PTY spawn","messagePattern":"missing program for PTY spawn","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/utils/pty/src/pty.rs","lineNumber":137,"sourceCode":"    #[cfg(not(windows))]\n    {\n        native_pty_system()\n    }\n}\n\n/// Spawn a process attached to a PTY, preserving selected inherited file\n/// descriptors across exec on Unix.\npub async fn spawn_process(\n    program: &str,\n    args: &[String],\n    cwd: &Path,\n    env: &HashMap<String, String>,\n    arg0: &Option<String>,\n    size: TerminalSize,\n    inherited_fds: &[i32],\n) -> Result<SpawnedProcess> {\n    if program.is_empty() {\n        anyhow::bail!(\"missing program for PTY spawn\");\n    }\n\n    #[cfg(not(unix))]\n    let _ = inherited_fds;\n\n    #[cfg(unix)]\n    if !inherited_fds.is_empty() {\n        return spawn_process_preserving_fds(program, args, cwd, env, arg0, size, inherited_fds)\n            .await;\n    }\n\n    spawn_process_portable(program, args, cwd, env, arg0, size).await\n}\n\nasync fn spawn_process_portable(\n    program: &str,\n    args: &[String],\n    cwd: &Path,","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/utils/pty/src/pty.rs#L119-L155","documentation":"The PTY spawn entry point was called with an empty program string. The guard fires before any PTY allocation; the command to run was never configured.","triggerScenarios":"Thrown at codex-rs/utils/pty/src/pty.rs:137 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Populate the command/program field before spawning","Default to an interactive shell when program is empty","Validate command configuration upstream and report a user-facing error"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}