openai/codex · error · io::Error

remote control pairing status requires pairingCode or…

Error message

remote control pairing status requires pairingCode or manualPairingCode

What it means

Validation error from remote_control_pairing_status_code: neither pairingCode nor manualPairingCode was provided in the pairing-status params. At least one code is required to identify the pairing attempt, so the request fails input validation.

Solutions

  1. Populate either pairingCode or manualPairingCode from the pairing response before polling status
  2. Reject the call early in the client with a required-field validation error
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

    }
    enroll_remote_control_server(remote_control_target, auth, installation_id, server_name).await
}

fn remote_control_pairing_status_code(
    params: &RemoteControlPairingStatusParams,
) -> io::Result<RemoteControlPairingStatusCode> {
    match (&params.pairing_code, &params.manual_pairing_code) {
        (Some(pairing_code), None) => Ok(RemoteControlPairingStatusCode::PairingCode(
            pairing_code.clone(),
        )),
        (None, Some(manual_pairing_code)) => Ok(RemoteControlPairingStatusCode::ManualPairingCode(
            manual_pairing_code.clone(),
        )),
        (Some(_), Some(_)) => Err(io::Error::new(
            io::ErrorKind::InvalidInput,
            "remote control pairing status accepts either pairingCode or manualPairingCode, not both",
        )),
        (None, None) => Err(io::Error::new(
            io::ErrorKind::InvalidInput,
            "remote control pairing status requires pairingCode or manualPairingCode",
        )),
    }
}

async fn refresh_pairing_enrollment(
    current_enrollment: &mut Option<RemoteControlEnrollment>,
    auth_manager: &Arc<AuthManager>,
    auth: &mut auth::RemoteControlConnectionAuth,
    installation_id: &str,
    enrollment: &mut RemoteControlEnrollment,
) -> io::Result<()> {
    let mut refresh_result = refresh_remote_control_server(auth, installation_id, enrollment).await;
    if refresh_result
        .as_ref()
        .is_err_and(|err| err.kind() == io::ErrorKind::PermissionDenied)
    {

View on GitHub (pinned to 339751715c)