{"record":{"id":"05ed09ee62c9b8f1","repo":"openai/codex","slug":"timed-out-after-ms-waiting-for-runner-spawn-read","errorCode":null,"errorMessage":"timed out after {}ms waiting for runner spawn_ready","messagePattern":"timed out after (.+?)ms waiting for runner spawn_ready","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/elevated/runner_client.rs","lineNumber":479,"sourceCode":"        if ok == 0 {\n            let err = unsafe { GetLastError() } as i32;\n            return Err(anyhow::anyhow!(\n                \"PeekNamedPipe failed while waiting for spawn_ready: {err}\"\n            ));\n        }\n\n        if bytes_read == len_buf.len() as u32 {\n            let frame_len = u32::from_le_bytes(len_buf) as usize;\n            let total_len = frame_len\n                .checked_add(len_buf.len())\n                .ok_or_else(|| anyhow::anyhow!(\"runner frame length overflow\"))?;\n            if total_available as usize >= total_len {\n                return Ok(());\n            }\n        }\n\n        if Instant::now() >= deadline {\n            return Err(anyhow::anyhow!(\n                \"timed out after {}ms waiting for runner spawn_ready\",\n                timeout.as_millis()\n            ));\n        }\n\n        std::thread::sleep(RUNNER_SPAWN_READY_POLL_INTERVAL);\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::RunnerLogonError;\n    use super::RunnerStartupError;\n    use super::is_refreshable_sandbox_creds_error;\n    use crate::ipc_framed::ErrorPayload;\n    use crate::ipc_framed::ErrorStage;\n    use pretty_assertions::assert_eq;\n    use windows_sys::Win32::Foundation::ERROR_LOGON_FAILURE;","sourceCodeStart":461,"sourceCodeEnd":497,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/elevated/runner_client.rs#L461-L497","documentation":"Bailed by the elevated runner client when the named-pipe wait for the freshly spawned runner's spawn_ready frame exceeds the given millisecond budget (the frame never fully arrived). Indicates a hung runner startup; the caller treats the runner as unresponsive.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/elevated/runner_client.rs:479 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Increase the spawn_ready timeout","Check whether the runner is hung during initialization (inspect its logs)","Kill and respawn the runner with a fresh pipe pair"],"exampleFix":null,"handlingStrategy":"retry","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"}