openai/codex · error · anyhow::Error

Windows sandbox process spawn is unavailable on this…

Error message

Windows sandbox process spawn is unavailable on this platform

What it means

Compile-time/platform sentinel: construction of a WindowsSandboxSessionRequest resolved to a cfg-gated stub that panics because the Windows sandbox session is not built for this platform.

Solutions

  1. Build/run on Windows to use the Windows sandbox
  2. Use the platform-appropriate sandbox backend (Seatbelt/Landlock) instead
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/sandboxing/src/spawn.rs:90 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at codex-rs/sandboxing/src/spawn.rs:90

                        .is_some_and(|value| value.read_roots_include_platform_defaults),
                    write_roots_override: overrides
                        .and_then(|value| value.write_roots_override.as_deref()),
                    deny_read_paths_override: overrides.map_or(empty_paths, |value| {
                        value.additional_deny_read_paths.as_slice()
                    }),
                    deny_write_paths_override: overrides.map_or(empty_paths, |value| {
                        value.additional_deny_write_paths.as_slice()
                    }),
                    tty: request.tty,
                    stdin_open: request.stdin_open,
                    use_private_desktop: windows.use_private_desktop,
                },
            )
            .await;
        }

        #[cfg(not(target_os = "windows"))]
        anyhow::bail!("Windows sandbox process spawn is unavailable on this platform");
    }

    let (program, args) = request
        .command
        .split_first()
        .context("missing program for process spawn")?;
    if request.tty {
        codex_utils_pty::pty::spawn_process(
            program,
            args,
            request.cwd,
            request.env,
            request.arg0,
            TerminalSize::default(),
            request.inherited_fds,
        )
        .await
    } else if request.stdin_open {

View on GitHub (pinned to 339751715c)