openai/codex · error · io::Error

invalid remote control URL

Error message

invalid remote control URL `{remote_control_url}`: {err}

What it means

InvalidInput error from normalize_remote_control_url: the configured remote-control base URL could not be parsed/joined into endpoint URLs (enroll, refresh, pair, pair/status, websocket). The underlying url::ParseError is appended, so a malformed or scheme-relative URL is the fault; the offending URL is echoed in the message.

Solutions

  1. Correct the remote control URL in config so it is an absolute http/https URL that can host the wham/remote/control/server/* paths
  2. Fail fast on URL validation when loading config instead of at first use
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/app-server-transport/src/transport/remote_control/protocol.rs:217 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/94e2eae283e7c763. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/app-server-transport/src/transport/remote_control/protocol.rs:217

        || host.ends_with(".chatgpt.com")
        || host.ends_with(".chatgpt-staging.com")
}

fn is_localhost(host: &Option<Host<&str>>) -> bool {
    match host {
        Some(Host::Domain("localhost")) => true,
        Some(Host::Ipv4(ip)) => ip.is_loopback(),
        Some(Host::Ipv6(ip)) => ip.is_loopback(),
        _ => false,
    }
}

pub(super) fn normalize_remote_control_url(
    remote_control_url: &str,
) -> io::Result<RemoteControlTarget> {
    let remote_control_url = normalize_remote_control_base_url(remote_control_url)?;
    let map_url_parse_error = |err: url::ParseError| -> io::Error {
        io::Error::new(
            ErrorKind::InvalidInput,
            format!("invalid remote control URL `{remote_control_url}`: {err}"),
        )
    };

    let enroll_url = remote_control_url
        .join("wham/remote/control/server/enroll")
        .map_err(map_url_parse_error)?;
    let refresh_url = remote_control_url
        .join("wham/remote/control/server/refresh")
        .map_err(map_url_parse_error)?;
    let pair_url = remote_control_url
        .join("wham/remote/control/server/pair")
        .map_err(map_url_parse_error)?;
    let pair_status_url = remote_control_url
        .join("wham/remote/control/server/pair/status")
        .map_err(map_url_parse_error)?;
    let mut websocket_url = remote_control_url

View on GitHub (pinned to 339751715c)