{"record":{"id":"1d19b163303a2547","repo":"openai/codex","slug":"spawned-conpty-is-missing-its-process-job","errorCode":null,"errorMessage":"spawned ConPTY is missing its process job","messagePattern":"spawned ConPTY is missing its process job","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/unified_exec/backends/legacy.rs","lineNumber":87,"sourceCode":"    let (pi, job, output_join, writer_handle, hpc, conpty_owner, desktop) = if tty {\n        let (pi, mut conpty) =\n            spawn_conpty_process_as_user(h_token, command, cwd, env_map, launch_desktop)?;\n        let job = conpty\n            .job()\n            .ok_or_else(|| anyhow::anyhow!(\"spawned ConPTY is missing its process job\"))?;\n        let hpc = conpty.raw_handle();\n        let output_join = spawn_output_reader(conpty.take_output_read(), stdout_tx);\n        let writer_handle = spawn_input_writer(\n            Some(conpty.take_input_write()),\n            writer_rx,\n            /*normalize_newlines*/ true,\n        );\n        (pi, job, output_join, writer_handle, hpc, Some(conpty), None)","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/unified_exec/backends/legacy.rs#L69-L105","documentation":"Invariant guard after spawning a ConPTY-backed child: the freshly created ConPTY object is expected to always expose its process job object, but the accessor returned None. This indicates the ConPTY structure was not fully initialized by the OS (CreatePseudoConsole/initialization path returned an object without an attached job), an unexpected internal state rather than a caller error.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/unified_exec/backends/legacy.rs:87 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["This is an internal invariant after ConPTY spawn; retry the command and, if it persists, report a bug with the sandbox backend logs."],"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"}