openai/codex · error · io::Error

remote control client list limit must be between 1 and 100

Error message

remote control client list limit must be between 1 and 100

What it means

The optional page size for listing remote-control clients is validated client-side: a limit that is present but outside 1..=100 is rejected with InvalidInput before any HTTP request. limit = None is valid and lets the server choose; only an explicitly out-of-range value fails.

Source

Thrown at codex-rs/app-server-transport/src/transport/remote_control/clients.rs:84

    body: Vec<u8>,
}

pub(super) async fn list_remote_control_clients(
    remote_control_url: &str,
    auth_manager: &Arc<AuthManager>,
    params: RemoteControlClientsListParams,
) -> io::Result<RemoteControlClientsListResponse> {
    if params.environment_id.is_empty() {
        return Err(io::Error::new(
            ErrorKind::InvalidInput,
            "remote control client list requires environmentId",
        ));
    }
    if params
        .limit
        .is_some_and(|limit| !(1..=100).contains(&limit))
    {
        return Err(io::Error::new(
            ErrorKind::InvalidInput,
            "remote control client list limit must be between 1 and 100",
        ));
    }
    let url = environment_clients_url(remote_control_url, &params.environment_id)?;
    let response = send_client_management_request(
        auth_manager,
        ClientManagementRequest::List {
            url: &url,
            params: &params,
        },
        "list remote control clients",
    )
    .await?;
    let ClientManagementResponse {
        status,
        headers,
        body,

View on GitHub (pinned to 339751715c)

Solutions

  1. Clamp the requested limit into 1..=100 before sending
  2. Omit limit (None) when the caller means 'server default'
  3. Page through large listings with cursor + limit <= 100 instead of one large request

Example fix

// before
let params = RemoteControlClientsListParams {
    environment_id,
    limit: Some(0),
    ..Default::default()
};

// after
let params = RemoteControlClientsListParams {
    environment_id,
    limit: None, // or Some(requested.clamp(1, 100))
    ..Default::default()
};
Defensive patterns

Strategy: validation

Validate before calling

const LIMIT_MIN = 1;
const LIMIT_MAX = 100;
function normalizeLimit(limit?: number): number | undefined {
  if (limit === undefined) return undefined;
  return Math.min(Math.max(Math.trunc(limit), LIMIT_MIN), LIMIT_MAX);
}

Prevention

When it happens

Trigger: Passing RemoteControlClientsListParams { limit: Some(0), .. } or Some(n) with n > 100 to list_remote_control_clients or the corresponding app-server remoteControl clients list RPC.

Common situations: UI page-size selectors offering 'show all' that pass the total count or 0; cursor math computing limit = remaining_items which can exceed 100; limits copied from other APIs with higher caps.

Related errors


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/79ed0dac01b11b1b. Report an issue: GitHub.