{"record":{"id":"31b2e81eb6dd15a2","repo":"openai/codex","slug":"failed-to-resize-console-to-x-hresult","errorCode":null,"errorMessage":"failed to resize console to {}x{}: HRESULT: {}","messagePattern":"failed to resize console to (.+?)x(.+?): HRESULT: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/utils/pty/src/win/psuedocon.rs","lineNumber":156,"sourceCode":"                output.as_raw_handle() as _,\n                PSEUDOCONSOLE_RESIZE_QUIRK,\n                &mut con,\n            )\n        };\n        ensure!(\n            result == S_OK,\n            \"failed to create psuedo console: HRESULT {result}\"\n        );\n        Ok(Self {\n            con,\n            _input: input,\n            _output: output,\n        })\n    }\n\n    pub fn resize(&self, size: COORD) -> Result<(), Error> {\n        let result = unsafe { (CONPTY.ResizePseudoConsole)(self.con, size) };\n        ensure!(\n            result == S_OK,\n            \"failed to resize console to {}x{}: HRESULT: {}\",\n            size.X,\n            size.Y,\n            result\n        );\n        Ok(())\n    }\n\n    pub fn spawn_command(&self, cmd: CommandBuilder) -> anyhow::Result<WinChild> {\n        let job = Arc::new(JobObject::create()?);\n        let mut si: STARTUPINFOEXW = unsafe { mem::zeroed() };\n        si.StartupInfo.cb = mem::size_of::<STARTUPINFOEXW>() as u32;\n        si.StartupInfo.dwFlags = STARTF_USESTDHANDLES;\n        si.StartupInfo.hStdInput = INVALID_HANDLE_VALUE;\n        si.StartupInfo.hStdOutput = INVALID_HANDLE_VALUE;\n        si.StartupInfo.hStdError = INVALID_HANDLE_VALUE;\n","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/utils/pty/src/win/psuedocon.rs#L138-L174","documentation":"Error \"failed to resize console to {}x{}: HRESULT: {}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/utils/pty/src/win/psuedocon.rs:156 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"}