openai/codex · error · io::Error

io::ErrorKind::Interrupted

io::ErrorKind::Interrupted

Error message

remote control account changed during enrollment

What it means

Concurrency/consistency error during enable(): the authenticated account identity changed while the enrollment flow was in progress (detected when comparing state captured before and after load_or_enroll_server under the enrollment lock). Enabling must be atomic per account, so the operation is aborted and the caller can retry with the settled account.

Solutions

  1. Retry the enable request; on success the account is stable.
  2. If it recurs, serialize account switches and remote-control enable in the client, and re-check auth before enrollment.
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

Thrown at codex-rs/app-server-transport/src/transport/remote_control/desired_state.rs:130

        let remote_control_target = normalize_remote_control_url(&self.remote_control_url)?;
        let app_server_client_name = self.pairing_persistence_key(app_server_client_name)?;
        let app_server_client_name = app_server_client_name.as_deref();
        let status = self.status();
        let mut current_enrollment = self.current_enrollment.lock().await;
        let (enrollment, _) = self
            .load_or_enroll_server(
                &current_enrollment,
                &mut auth,
                &status.installation_id,
                &status.server_name,
                app_server_client_name,
                super::RemoteControlEnrollmentSelection::ReuseOrCreate,
            )
            .await?;

        let current_auth = super::auth::load_remote_control_auth(&self.auth_manager).await?;
        if current_auth.account_id != auth.account_id {
            return Err(io::Error::new(
                io::ErrorKind::Interrupted,
                "remote control account changed during enrollment",
            ));
        }

        let _persistence = acquire_persistence_lock(&self.desired_state_persistence_lock).await;
        let updated = state_db
            .set_remote_control_enabled(
                &remote_control_target.websocket_url,
                &auth.account_id,
                app_server_client_name,
                /*remote_control_enabled*/ true,
            )
            .await
            .map_err(io::Error::other)?;
        if updated == 0 {
            update_persisted_remote_control_enrollment(
                Some(state_db),

View on GitHub (pinned to 339751715c)