{"record":{"id":"d13a099b5f542206","repo":"openai/codex","slug":"network-proxy-attribution-token-is-too-long","errorCode":null,"errorMessage":"network proxy attribution token is too long","messagePattern":"network proxy attribution token is too long","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/network-proxy/src/attribution.rs","lineNumber":131,"sourceCode":"            io::ErrorKind::TimedOut,\n            \"network proxy attribution frame timed out\",\n        )\n    })??;\n\n    Ok(Some(token))\n}\n\n/// Writes the trusted bridge preface consumed by the shared proxy ingress.\n#[doc(hidden)]\npub fn write_attribution_frame(writer: &mut impl Write, token: &str) -> io::Result<()> {\n    if token.is_empty() || token.len() > MAX_ATTRIBUTION_TOKEN_LEN {\n        return Err(io::Error::new(\n            io::ErrorKind::InvalidInput,\n            \"invalid network proxy attribution token length\",\n        ));\n    }\n    let token_len = u16::try_from(token.len()).map_err(|_| {\n        io::Error::new(\n            io::ErrorKind::InvalidInput,\n            \"network proxy attribution token is too long\",\n        )\n    })?;\n    writer.write_all(ATTRIBUTION_FRAME_MAGIC)?;\n    writer.write_all(&token_len.to_be_bytes())?;\n    writer.write_all(token.as_bytes())\n}\n\n#[cfg(test)]\n#[path = \"attribution_tests.rs\"]\nmod tests;\n","sourceCodeStart":113,"sourceCodeEnd":144,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/network-proxy/src/attribution.rs#L113-L144","documentation":"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.","triggerScenarios":"Thrown at codex-rs/network-proxy/src/attribution.rs:131 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-empty token within the maximum attribution token length","Regenerate the token via the same API that issues it so length is correct","Treat token production bugs (empty/oversized) as failures before opening the connection"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}