{"record":{"id":"9de74cd7614cbe45","repo":"openai/codex","slug":"remote-control-pairing-is-unavailable-until-enroll","errorCode":null,"errorMessage":"remote control pairing is unavailable until enrollment completes","messagePattern":"remote control pairing is unavailable until enrollment completes","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/app-server-transport/src/transport/remote_control/mod.rs","lineNumber":879,"sourceCode":"    } else {\n        refresh_result\n    }\n}\n\nfn clear_pairing_server_token(\n    current_enrollment: &mut Option<RemoteControlEnrollment>,\n    enrollment: &mut RemoteControlEnrollment,\n) -> io::Result<()> {\n    enrollment.clear_server_token();\n    if replace_current_enrollment(current_enrollment, enrollment) {\n        Ok(())\n    } else {\n        Err(pairing_unavailable_error())\n    }\n}\n\nfn pairing_unavailable_error() -> io::Error {\n    io::Error::new(\n        io::ErrorKind::InvalidInput,\n        \"remote control pairing is unavailable until enrollment completes\",\n    )\n}\n\nfn remote_control_status_with_connection_status(\n    status: &RemoteControlStatusChangedNotification,\n    connection_status: RemoteControlConnectionStatus,\n) -> RemoteControlStatusChangedNotification {\n    RemoteControlStatusChangedNotification {\n        status: connection_status,\n        server_name: status.server_name.clone(),\n        installation_id: status.installation_id.clone(),\n        environment_id: if connection_status == RemoteControlConnectionStatus::Disabled {\n            None\n        } else {\n            status.environment_id.clone()\n        },","sourceCodeStart":861,"sourceCodeEnd":897,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/app-server-transport/src/transport/remote_control/mod.rs#L861-L897","documentation":"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.","triggerScenarios":"Thrown at codex-rs/app-server-transport/src/transport/remote_control/mod.rs:879 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait for enrollment to complete (watch the remote-control status) before issuing pairing requests","Re-enroll the server (enroll_pairing_server) to rebuild the enrollment and server token, then retry"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}