openai/codex · error · io::Error

remote control disabled before enrollment

Error message

remote control disabled before enrollment

What it means

Guard result in enroll_and_persist_remote_control_server: before performing (or reusing) enrollment, the desired-state watch reported the user disabled remote control. The enrollment attempt is abandoned and this message explains that the desired state flipped to disabled before enrollment could complete.

Solutions

  1. No fix needed — honor the user's disable request and tear down the connection
  2. If enrollment is still wanted, re-enable remote control and let a fresh connect cycle start enrollment again
Defensive patterns

Strategy: fallback

When it happens

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

Appendix: source

Thrown at codex-rs/app-server-transport/src/transport/remote_control/websocket.rs:1726

async fn enroll_and_persist_remote_control_server(
    remote_control_target: &RemoteControlTarget,
    state_db: &StateRuntime,
    auth_context: RemoteControlEnrollmentAuthContext<'_, '_>,
    enrollment: &mut Option<RemoteControlEnrollment>,
    connect_options: RemoteControlConnectOptions<'_>,
    status_publisher: &RemoteControlStatusPublisher,
    selection: RemoteControlEnrollmentSelection,
) -> io::Result<()> {
    match selection {
        RemoteControlEnrollmentSelection::ReuseOrCreate => {
            if enrollment.is_some() {
                return Ok(());
            }
        }
        RemoteControlEnrollmentSelection::ReplaceExisting => {}
    }
    if !connect_options.desired_state_tx.borrow().is_enabled() {
        return Err(io::Error::new(
            ErrorKind::Interrupted,
            "remote control disabled before enrollment",
        ));
    }

    info!(
        "creating new remote control enrollment: websocket_url={}, enroll_url={}, account_id={}",
        remote_control_target.websocket_url,
        remote_control_target.enroll_url,
        auth_context.auth.account_id
    );
    let new_enrollment = match enroll_remote_control_server(
        remote_control_target,
        auth_context.auth,
        connect_options.installation_id,
        connect_options.server_name,
    )
    .await

View on GitHub (pinned to 339751715c)