{"record":{"id":"625198c5132ae15b","repo":"openai/codex","slug":"remote-control-url-cannot-be-a-base","errorCode":null,"errorMessage":"remote control URL cannot be a base","messagePattern":"remote control URL cannot be a base","errorType":"validation","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/app-server-transport/src/transport/remote_control/clients.rs","lineNumber":144,"sourceCode":"    auth_manager: &Arc<AuthManager>,\n    params: RemoteControlClientsRevokeParams,\n) -> io::Result<RemoteControlClientsRevokeResponse> {\n    if params.environment_id.is_empty() {\n        return Err(io::Error::new(\n            ErrorKind::InvalidInput,\n            \"remote control client revoke requires environmentId\",\n        ));\n    }\n    if params.client_id.is_empty() {\n        return Err(io::Error::new(\n            ErrorKind::InvalidInput,\n            \"remote control client revoke requires clientId\",\n        ));\n    }\n    let mut url = environment_clients_url(remote_control_url, &params.environment_id)?;\n    url.path_segments_mut()\n        .map_err(|()| {\n            io::Error::new(\n                ErrorKind::InvalidInput,\n                \"remote control URL cannot be a base\",\n            )\n        })?\n        .push(&params.client_id);\n    let response = send_client_management_request(\n        auth_manager,\n        ClientManagementRequest::Revoke { url: &url },\n        \"revoke remote control client\",\n    )\n    .await?;\n    let ClientManagementResponse {\n        status,\n        headers,\n        body,\n    } = response;\n    let body_preview = preview_remote_control_response_body(&body);\n    ensure_success_response(status, &headers, &url, &body_preview, \"client revoke\")?;","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/app-server-transport/src/transport/remote_control/clients.rs#L126-L162","documentation":"While appending the client id to the revoke URL, Url::path_segments_mut() failed because the configured remote-control base URL cannot be a base: it parses as a URL but has no hierarchical path to append segments to (url::Url::cannot_be_a_base(), true for opaque schemes like mailto: or data:). The InvalidInput error surfaces the misconfiguration before any request is sent; the same guard exists in environment_clients_url for the list path.","triggerScenarios":"revoke_remote_control_client or list_remote_control_clients with a remote_control_url that Url::parse accepts but that is not an http(s)-style hierarchical URL — e.g. 'mailto:ops@example.com' or another opaque-scheme value coming from config or an env var.","commonSituations":"remote_control_url populated from a config template or env var carrying a placeholder or copied link; values that lost their https:// scheme; any non-hierarchical scheme slipping through earlier normalization.","solutions":["Set remote_control_url to a full hierarchical URL, e.g. https://chatgpt.com/backend-api/","Validate the configured URL early: Url::parse(...).map(|u| !u.cannot_be_a_base())","Source the value only from the documented config key, not free-form env vars"],"exampleFix":"// before (config.toml)\nremote_control_url = \"chatgpt-remote:/control\"\n\n// after (config.toml)\nremote_control_url = \"https://chatgpt.com/backend-api/\"","handlingStrategy":"validation","validationCode":"fn is_valid_remote_control_url(s: &str) -> bool {\n    url::Url::parse(s)\n        .map(|u| !u.cannot_be_a_base() && matches!(u.scheme(), \"http\" | \"https\"))\n        .unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate remote_control_url at config load time, not at first request","Prefer scheme-checked constants/defaults over user-supplied URL strings","Smoke-test URL construction for the configured base in CI"],"tags":["url","config","remote-control","invalid-input","rust"],"backgroundTag":"url-cannot-be-a-base","analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}