{"record":{"id":"d9c66d64d826f4db","repo":"openai/codex","slug":"runner-expected-spawn-request-got-other","errorCode":null,"errorMessage":"runner: expected spawn_request, got {other:?}","messagePattern":"runner: expected spawn_request, got (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/bin/command_runner/win.rs","lineNumber":193,"sourceCode":"    err.chain().find_map(|cause| {\n        cause\n            .downcast_ref::<std::io::Error>()\n            .and_then(std::io::Error::raw_os_error)\n            .and_then(|code| u32::try_from(code).ok())\n    })\n}\n\n/// Read and validate the initial spawn request frame.\nfn read_spawn_request(reader: &mut File) -> Result<SpawnRequest> {\n    let Some(msg) = read_frame(reader)? else {\n        anyhow::bail!(\"runner: pipe closed before spawn_request\");\n    };\n    if msg.version != IPC_PROTOCOL_VERSION {\n        anyhow::bail!(\"runner: unsupported protocol version {}\", msg.version);\n    }\n    match msg.message {\n        Message::SpawnRequest { payload } => Ok(*payload),\n        other => anyhow::bail!(\"runner: expected spawn_request, got {other:?}\"),\n    }\n}\n\nfn read_acl_mutex_exists() -> Result<bool> {\n    let name = to_wide(OsStr::new(READ_ACL_MUTEX_NAME));\n    let handle = unsafe { OpenMutexW(MUTEX_ALL_ACCESS, 0, name.as_ptr()) };\n    if handle == 0 {\n        let err = unsafe { GetLastError() };\n        if err == ERROR_FILE_NOT_FOUND {\n            return Ok(false);\n        }\n        return Err(anyhow::anyhow!(\"OpenMutexW failed: {err}\"));\n    }\n    unsafe {\n        CloseHandle(handle);\n    }\n    Ok(true)\n}","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/bin/command_runner/win.rs#L175-L211","documentation":"Error \"runner: expected spawn_request, got {other:?}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/bin/command_runner/win.rs:193 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"}