{"record":{"id":"a1de9816cd5b231b","repo":"openai/codex","slug":"expected-spawn-ready-from-runner-got-other","errorCode":null,"errorMessage":"expected spawn_ready from runner, got {other:?}","messagePattern":"expected spawn_ready from runner, got (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/elevated/runner_client.rs","lineNumber":166,"sourceCode":"impl RunnerTransport {\n    pub(crate) fn send_spawn_request(&mut self, request: SpawnRequest) -> Result<()> {\n        let spawn_request = FramedMessage {\n            version: IPC_PROTOCOL_VERSION,\n            message: Message::SpawnRequest {\n                payload: Box::new(request),\n            },\n        };\n        write_frame(&mut self.pipe_write, &spawn_request)\n    }\n\n    pub(crate) fn read_spawn_ready(&mut self) -> Result<()> {\n        wait_for_complete_frame(&self.pipe_read, RUNNER_SPAWN_READY_TIMEOUT)?;\n        let msg = read_frame(&mut self.pipe_read)?\n            .ok_or_else(|| anyhow::anyhow!(\"runner pipe closed before spawn_ready\"))?;\n        match msg.message {\n            Message::SpawnReady { .. } => Ok(()),\n            Message::Error { payload } => Err(RunnerStartupError::new(payload).into()),\n            other => Err(anyhow::anyhow!(\n                \"expected spawn_ready from runner, got {other:?}\"\n            )),\n        }\n    }\n\n    pub(crate) fn into_files(self) -> (File, File) {\n        (self.pipe_write, self.pipe_read)\n    }\n}\n\nfn try_take_completed_connect_result(\n    connect_thread: &mut Option<thread::JoinHandle<()>>,\n    connect_result_rx: &mpsc::Receiver<Result<()>>,\n    thread_handle: HANDLE,\n    pipe_label: &str,\n) -> Result<Option<Result<()>>> {\n    let thread_wait = unsafe { WaitForSingleObject(thread_handle, 0) };\n    if thread_wait != WAIT_OBJECT_0 {","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/elevated/runner_client.rs#L148-L184","documentation":"Protocol violation in read_spawn_ready: a complete frame arrived on the runner pipe, but its message variant is not the expected SpawnReady handshake. The unexpected Message variant is included in the error, indicating the runner spoke out of order or the streams are desynchronized.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/elevated/runner_client.rs:166 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check which message variant arrived to infer the desynchronization cause","Verify both sides use the same IPC_PROTOCOL_VERSION so message ordering matches","Restart the runner and client so the handshake begins from a clean state"],"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"}