openai/codex · error · io::Error

remote control pairing is unavailable until enrollment…

Error message

remote control pairing is unavailable until enrollment completes

What it means

Sentinel InvalidInput error produced by pairing_unavailable_error and used by several pairing flows (start_pairing, pairing_status, enrollment refresh, token clearing). It fires when an in-memory RemoteControlEnrollment with a server token is expected but the current enrollment slot is empty or was replaced — i.e. enrollment has not completed (or was cleared), so pairing operations cannot proceed yet.

Solutions

  1. Wait for enrollment to complete (watch the remote-control status) before issuing pairing requests
  2. Re-enroll the server (enroll_pairing_server) to rebuild the enrollment and server token, then retry
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at codex-rs/app-server-transport/src/transport/remote_control/mod.rs:879 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/9de74cd7614cbe45. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/app-server-transport/src/transport/remote_control/mod.rs:879

    } else {
        refresh_result
    }
}

fn clear_pairing_server_token(
    current_enrollment: &mut Option<RemoteControlEnrollment>,
    enrollment: &mut RemoteControlEnrollment,
) -> io::Result<()> {
    enrollment.clear_server_token();
    if replace_current_enrollment(current_enrollment, enrollment) {
        Ok(())
    } else {
        Err(pairing_unavailable_error())
    }
}

fn pairing_unavailable_error() -> io::Error {
    io::Error::new(
        io::ErrorKind::InvalidInput,
        "remote control pairing is unavailable until enrollment completes",
    )
}

fn remote_control_status_with_connection_status(
    status: &RemoteControlStatusChangedNotification,
    connection_status: RemoteControlConnectionStatus,
) -> RemoteControlStatusChangedNotification {
    RemoteControlStatusChangedNotification {
        status: connection_status,
        server_name: status.server_name.clone(),
        installation_id: status.installation_id.clone(),
        environment_id: if connection_status == RemoteControlConnectionStatus::Disabled {
            None
        } else {
            status.environment_id.clone()
        },

View on GitHub (pinned to 339751715c)