{"record":{"id":"322e6c4c7c685f69","repo":"openai/codex","slug":"oauth-http-response-body-exceeds-maximum-bytes-b","errorCode":null,"errorMessage":"OAuth HTTP response body exceeds {maximum_bytes} bytes","messagePattern":"OAuth HTTP response body exceeds (.+?) bytes","errorType":"exception","errorClass":"OAuthHttpClientAdapterError","httpStatus":null,"severity":"error","filePath":"codex-rs/rmcp-client/src/oauth_http_client.rs","lineNumber":49,"sourceCode":"use url::Url;\n\nuse crate::auth_status::OAuthDiscoveryTimeout;\nuse crate::http_client_adapter::StreamableHttpRedirectMode;\nuse crate::utils::MCP_USER_AGENT;\n\nconst MAX_OAUTH_HTTP_RESPONSE_BODY_BYTES: usize = 1024 * 1024;\nconst MAX_OAUTH_HTTP_REDIRECTS: usize = 10;\nstatic NEXT_OAUTH_REQUEST_ID: AtomicU64 = AtomicU64::new(0);\n\n#[derive(Debug, thiserror::Error)]\nenum OAuthHttpClientAdapterError {\n    #[error(\"unsupported OAuth HTTP redirect policy\")]\n    UnsupportedRedirectPolicy,\n    #[error(\"OAuth HTTP request timed out\")]\n    TimedOut,\n    #[error(\"OAuth HTTP request exceeded {MAX_OAUTH_HTTP_REDIRECTS} redirects\")]\n    TooManyRedirects,\n    #[error(\"OAuth HTTP response body exceeds {maximum_bytes} bytes\")]\n    ResponseBodyTooLarge { maximum_bytes: usize },\n    #[error(\"OAuth authorization server issuer does not match authorization metadata origin\")]\n    AuthorizationMetadataIssuerOriginMismatch,\n}\n\nfn oauth_http_client_error(\n    error: impl std::error::Error + Send + Sync + 'static,\n) -> OAuthHttpClientError {\n    Box::new(error)\n}\n\n#[derive(Clone)]\npub(crate) struct OAuthHttpClientAdapter {\n    http_client: Arc<dyn HttpClient>,\n    default_headers: HeaderMap,\n    resource_origin: Origin,\n    timeout: OAuthDiscoveryTimeout,\n    has_configured_headers: bool,","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rmcp-client/src/oauth_http_client.rs#L31-L67","documentation":"Error \"OAuth HTTP response body exceeds {maximum_bytes} bytes\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rmcp-client/src/oauth_http_client.rs:49 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}