{"record":{"id":"c0ce2d2079484ffe","repo":"openai/codex","slug":"failed-to-resize-console-hresult-result","errorCode":null,"errorMessage":"failed to resize console: HRESULT {result}","messagePattern":"failed to resize console: HRESULT (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/unified_exec/backends/legacy.rs","lineNumber":300,"sourceCode":"        .lock()\n        .map_err(|_| anyhow::anyhow!(\"failed to lock ConPTY handle\"))?;\n    let hpc = guard\n        .as_ref()\n        .copied()\n        .ok_or_else(|| anyhow::anyhow!(\"process is not attached to a PTY\"))?;\n    let result = unsafe {\n        ResizePseudoConsole(\n            hpc,\n            COORD {\n                X: size.cols as i16,\n                Y: size.rows as i16,\n            },\n        )\n    };\n    if result == 0 {\n        Ok(())\n    } else {\n        Err(anyhow::anyhow!(\n            \"failed to resize console: HRESULT {result}\"\n        ))\n    }\n}\n\n#[allow(clippy::too_many_arguments)]\npub(crate) async fn spawn_windows_sandbox_session_legacy(\n    permission_profile: &PermissionProfile,\n    workspace_roots: &[AbsolutePathBuf],\n    codex_home: &Path,\n    command: Vec<String>,\n    cwd: &Path,\n    mut env_map: HashMap<String, String>,\n    timeout_ms: Option<u64>,\n    additional_deny_read_paths: &[AbsolutePathBuf],\n    additional_deny_write_paths: &[AbsolutePathBuf],\n    tty: bool,\n    stdin_open: bool,","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/unified_exec/backends/legacy.rs#L282-L318","documentation":"Error \"failed to resize console: HRESULT {result}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/unified_exec/backends/legacy.rs:300 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the requested console dimensions are within valid bounds and retry; inspect the HRESULT for the concrete failure."],"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"}