openai/codex · error · io::Error

network proxy attribution token is too long

Error message

network proxy attribution token is too long

What it means

write_attribution_frame validated the trusted preface token before writing it to the bridge connection: it is empty or exceeds MAX_ATTRIBUTION_TOKEN_LEN, so the frame cannot encode it within its u16 length prefix. The caller-supplied token is the faulty input.

Solutions

  1. Pass a non-empty token within the maximum attribution token length
  2. Regenerate the token via the same API that issues it so length is correct
  3. Treat token production bugs (empty/oversized) as failures before opening the connection
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/network-proxy/src/attribution.rs:131 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/d13a099b5f542206. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/network-proxy/src/attribution.rs:131

            io::ErrorKind::TimedOut,
            "network proxy attribution frame timed out",
        )
    })??;

    Ok(Some(token))
}

/// Writes the trusted bridge preface consumed by the shared proxy ingress.
#[doc(hidden)]
pub fn write_attribution_frame(writer: &mut impl Write, token: &str) -> io::Result<()> {
    if token.is_empty() || token.len() > MAX_ATTRIBUTION_TOKEN_LEN {
        return Err(io::Error::new(
            io::ErrorKind::InvalidInput,
            "invalid network proxy attribution token length",
        ));
    }
    let token_len = u16::try_from(token.len()).map_err(|_| {
        io::Error::new(
            io::ErrorKind::InvalidInput,
            "network proxy attribution token is too long",
        )
    })?;
    writer.write_all(ATTRIBUTION_FRAME_MAGIC)?;
    writer.write_all(&token_len.to_be_bytes())?;
    writer.write_all(token.as_bytes())
}

#[cfg(test)]
#[path = "attribution_tests.rs"]
mod tests;

View on GitHub (pinned to 339751715c)