openai/codex · error · anyhow::Error

timed out after ms connecting runner

Error message

timed out after {}ms connecting runner {pipe_label}

What it means

The named-pipe connection to the elevated runner process did not complete within the configured connect timeout (after attempting to cancel the blocking connect thread). Fired from the mpsc RecvTimeoutError::Timeout path when no completed connect result arrived in time, meaning the runner likely never started listening on the pipe.

Solutions

  1. Increase the connect timeout if the runner is slow to boot
  2. Verify the runner executable was materialized and launched successfully
  3. Check for a stale pipe name collision or the runner dying during startup (inspect runner logs)
  4. Retry the whole runner spawn/connect cycle with a fresh pipe pair
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at codex-rs/windows-sandbox-rs/src/elevated/runner_client.rs:277 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/2fd085cc600cb77b. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/windows-sandbox-rs/src/elevated/runner_client.rs:277

            )? {
                result
            } else {
                let cancel_ok = unsafe { CancelSynchronousIo(thread_handle) };
                if cancel_ok == 0 {
                    let err = unsafe { GetLastError() };
                    if err != ERROR_NOT_FOUND {
                        Err(anyhow::anyhow!(
                            "CancelSynchronousIo failed for runner {pipe_label} connect thread: {err}"
                        ))
                    } else if let Some(result) = try_take_completed_connect_result(
                        &mut connect_thread,
                        &connect_result_rx,
                        thread_handle,
                        &pipe_label,
                    )? {
                        result
                    } else {
                        Err(anyhow::anyhow!(
                            "timed out after {}ms connecting runner {pipe_label}",
                            RUNNER_PIPE_CONNECT_TIMEOUT.as_millis()
                        ))
                    }
                } else {
                    // Do not join the helper thread on the timeout path. Parent-side cleanup will
                    // close the pipe handles, which lets the blocked connect unwind without
                    // risking another indefinite wait here.
                    Err(anyhow::anyhow!(
                        "timed out after {}ms connecting runner {pipe_label}",
                        RUNNER_PIPE_CONNECT_TIMEOUT.as_millis()
                    ))
                }
            }
        }
        Err(mpsc::RecvTimeoutError::Disconnected) => {
            if let Some(connect_thread) = connect_thread.take() {
                let _ = connect_thread.join();

View on GitHub (pinned to 339751715c)