openai/codex · error · io::Error

NotFound

NotFound

Error message

missing proxy env key {}

What it means

Error "missing proxy env key {}" thrown in openai/codex.

Source

Thrown at codex-rs/linux-sandbox/src/proxy_routing.rs:179

    let mut local_port_by_uds_path: BTreeMap<PathBuf, u16> = BTreeMap::new();
    for route in &spec.routes {
        if local_port_by_uds_path.contains_key(&route.uds_path) {
            continue;
        }
        let local_port = spawn_local_bridge(route.uds_path.as_path())?;
        local_port_by_uds_path.insert(route.uds_path.clone(), local_port);
    }

    for route in spec.routes {
        let Some(local_port) = local_port_by_uds_path.get(&route.uds_path) else {
            return Err(io::Error::other(format!(
                "missing local bridge port for UDS path {}",
                route.uds_path.display()
            )));
        };
        let original_value = std::env::var(&route.env_key).map_err(|_| {
            io::Error::new(
                io::ErrorKind::NotFound,
                format!("missing proxy env key {}", route.env_key),
            )
        })?;
        let Some(rewritten) = rewrite_proxy_env_value(&original_value, *local_port) else {
            return Err(io::Error::new(
                io::ErrorKind::InvalidInput,
                format!("could not rewrite proxy URL for env key {}", route.env_key),
            ));
        };
        // SAFETY: this helper process is single-threaded at this point, and
        // env mutation happens before execing the user command.
        unsafe {
            std::env::set_var(route.env_key, rewritten);
        }
    }

    Ok(())

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/linux-sandbox/src/proxy_routing.rs:179 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/5cc6eede38ef819f. Report an issue: GitHub.