openai/codex · error · anyhow::Error

invalid --sandbox-state-json value: {err}

Error message

invalid --sandbox-state-json value: {err}

What it means

Error "invalid --sandbox-state-json value: {err}" thrown in openai/codex.

Source

Thrown at codex-rs/cli/src/debug_sandbox.rs:218

}

async fn run_command_under_sandbox(
    mut config_options: DebugSandboxConfigOptions,
    command: Vec<String>,
    config_overrides: CliConfigOverrides,
    codex_linux_sandbox_exe: Option<PathBuf>,
    sandbox_type: SandboxType,
    log_denials: bool,
    #[cfg_attr(not(target_os = "macos"), allow(unused_variables))]
    allow_unix_sockets: &[AbsolutePathBuf],
) -> anyhow::Result<()> {
    let sandbox_state = config_options
        .sandbox_state
        .sandbox_state_json
        .as_deref()
        .map(serde_json::from_str::<codex_mcp::SandboxState>)
        .transpose()
        .map_err(|err| anyhow::anyhow!("invalid --sandbox-state-json value: {err}"))?;
    let sandbox_state_readable_root = config_options
        .sandbox_state
        .sandbox_state_readable_root
        .clone();
    let sandbox_state_disable_network = config_options.sandbox_state.sandbox_state_disable_network;
    let codex_linux_sandbox_exe = match sandbox_state.as_ref() {
        Some(state) => {
            config_options.cwd = Some(
                state
                    .sandbox_cwd
                    .to_abs_path()
                    .context("sandbox state cwd is not native to this host")?
                    .to_path_buf(),
            );
            state
                .codex_linux_sandbox_exe
                .clone()
                .or(codex_linux_sandbox_exe)

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/cli/src/debug_sandbox.rs:218 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/883cd254d9e3502f. Report an issue: GitHub.