{"record":{"id":"1227b1bd245c24a7","repo":"BigPizzaV3/CodexPlusPlus","slug":"llm-bridge-1227b1","errorCode":null,"errorMessage":"LLM Bridge 响应体过大","messagePattern":"LLM Bridge 响应体过大","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/routes.rs","lineNumber":740,"sourceCode":"        .redirect(reqwest::redirect::Policy::none())\n        .build()?;\n    let response = client\n        .post(url)\n        .headers(llm_proxy_headers(&payload)?)\n        .body(body)\n        .send()\n        .await?;\n    let http_status = response.status().as_u16();\n    let ok = response.status().is_success();\n    let content_type = response\n        .headers()\n        .get(reqwest::header::CONTENT_TYPE)\n        .and_then(|value| value.to_str().ok())\n        .unwrap_or_default()\n        .to_string();\n    if let Some(length) = response.content_length() {\n        if length > 4 * 1024 * 1024 {\n            anyhow::bail!(\"LLM Bridge 响应体过大\");\n        }\n    }\n    let bytes = response.bytes().await?;\n    if bytes.len() > 4 * 1024 * 1024 {\n        anyhow::bail!(\"LLM Bridge 响应体过大\");\n    }\n    let body_text = String::from_utf8_lossy(&bytes).to_string();\n    let body_json = if content_type\n        .split(';')\n        .next()\n        .map(str::trim)\n        .is_some_and(|value| value.eq_ignore_ascii_case(\"application/json\"))\n    {\n        serde_json::from_slice::<Value>(&bytes).ok()\n    } else {\n        None\n    };\n","sourceCodeStart":722,"sourceCodeEnd":758,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/routes.rs#L722-L758","documentation":"Thrown by llm_proxy_value when the upstream response's declared Content-Length exceeds 4 MiB. This is the outbound size cap of the LLM Bridge proxy (there is a corresponding check on the streamed body afterwards); the offending input is the remote LLM endpoint's response size, and the proxy aborts rather than buffering an oversized reply.","triggerScenarios":"Thrown at crates/codex-plus-core/src/routes.rs:740 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["让上游返回更小的响应","检查端点是否返回了错误页面/大文件"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}