BigPizzaV3/CodexPlusPlus · error · anyhow::Error

LLM Bridge 响应体过大

Error message

LLM Bridge 响应体过大

What it means

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.

Source

Thrown at crates/codex-plus-core/src/routes.rs:740

        .redirect(reqwest::redirect::Policy::none())
        .build()?;
    let response = client
        .post(url)
        .headers(llm_proxy_headers(&payload)?)
        .body(body)
        .send()
        .await?;
    let http_status = response.status().as_u16();
    let ok = response.status().is_success();
    let content_type = response
        .headers()
        .get(reqwest::header::CONTENT_TYPE)
        .and_then(|value| value.to_str().ok())
        .unwrap_or_default()
        .to_string();
    if let Some(length) = response.content_length() {
        if length > 4 * 1024 * 1024 {
            anyhow::bail!("LLM Bridge 响应体过大");
        }
    }
    let bytes = response.bytes().await?;
    if bytes.len() > 4 * 1024 * 1024 {
        anyhow::bail!("LLM Bridge 响应体过大");
    }
    let body_text = String::from_utf8_lossy(&bytes).to_string();
    let body_json = if content_type
        .split(';')
        .next()
        .map(str::trim)
        .is_some_and(|value| value.eq_ignore_ascii_case("application/json"))
    {
        serde_json::from_slice::<Value>(&bytes).ok()
    } else {
        None
    };

View on GitHub (pinned to f2074595a2)

Solutions

  1. 让上游返回更小的响应
  2. 检查端点是否返回了错误页面/大文件
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/codex-plus-core/src/routes.rs:740 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23). Data as JSON: /api/errors/1227b1bd245c24a7. Report an issue: GitHub.