{"record":{"id":"79ed0dac01b11b1b","repo":"openai/codex","slug":"remote-control-client-list-limit-must-be-between-1","errorCode":null,"errorMessage":"remote control client list limit must be between 1 and 100","messagePattern":"remote control client list limit must be between 1 and 100","errorType":"validation","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/app-server-transport/src/transport/remote_control/clients.rs","lineNumber":84,"sourceCode":"    body: Vec<u8>,\n}\n\npub(super) async fn list_remote_control_clients(\n    remote_control_url: &str,\n    auth_manager: &Arc<AuthManager>,\n    params: RemoteControlClientsListParams,\n) -> io::Result<RemoteControlClientsListResponse> {\n    if params.environment_id.is_empty() {\n        return Err(io::Error::new(\n            ErrorKind::InvalidInput,\n            \"remote control client list requires environmentId\",\n        ));\n    }\n    if params\n        .limit\n        .is_some_and(|limit| !(1..=100).contains(&limit))\n    {\n        return Err(io::Error::new(\n            ErrorKind::InvalidInput,\n            \"remote control client list limit must be between 1 and 100\",\n        ));\n    }\n    let url = environment_clients_url(remote_control_url, &params.environment_id)?;\n    let response = send_client_management_request(\n        auth_manager,\n        ClientManagementRequest::List {\n            url: &url,\n            params: &params,\n        },\n        \"list remote control clients\",\n    )\n    .await?;\n    let ClientManagementResponse {\n        status,\n        headers,\n        body,","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/app-server-transport/src/transport/remote_control/clients.rs#L66-L102","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Clamp the requested limit into 1..=100 before sending","Omit limit (None) when the caller means 'server default'","Page through large listings with cursor + limit <= 100 instead of one large request"],"exampleFix":"// before\nlet params = RemoteControlClientsListParams {\n    environment_id,\n    limit: Some(0),\n    ..Default::default()\n};\n\n// after\nlet params = RemoteControlClientsListParams {\n    environment_id,\n    limit: None, // or Some(requested.clamp(1, 100))\n    ..Default::default()\n};","handlingStrategy":"validation","validationCode":"const LIMIT_MIN = 1;\nconst LIMIT_MAX = 100;\nfunction normalizeLimit(limit?: number): number | undefined {\n  if (limit === undefined) return undefined;\n  return Math.min(Math.max(Math.trunc(limit), LIMIT_MIN), LIMIT_MAX);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clamp limits in one client-SDK helper instead of at each call site","Add range annotations (1..=100) to request forms so validation happens before submit","Test pagination helpers with boundary values 0, 1, 100, 101"],"tags":["validation","pagination","remote-control","invalid-input"],"backgroundTag":"parameter-out-of-range","analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}