openai/codex · error · std::io::Error
code-mode IPC frame length
Error message
code-mode IPC frame length {length} exceeds {MAX_FRAME_BYTES} bytes What it means
decode_framed guard: the u32 length prefix of the IPC frame exceeds MAX_FRAME_BYTES, protecting the host from absurd allocations on malformed or hostile input. The declared length is embedded in the message.
Solutions
- Check for protocol version mismatch on frame limits
- Split large payloads into smaller messages
- Verify the peer is a compatible code-mode implementation
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at codex-rs/code-mode-protocol/src/host/codec.rs:67 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/23a8f5279e092197.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/code-mode-protocol/src/host/codec.rs:67
}
/// Decodes exactly one complete length-prefixed frame.
pub fn decode_framed<T>(bytes: &[u8]) -> io::Result<T>
where
T: DeserializeOwned,
{
let length_bytes: [u8; size_of::<u32>()] = bytes
.get(..size_of::<u32>())
.and_then(|length_bytes| length_bytes.try_into().ok())
.ok_or_else(|| {
io::Error::new(
io::ErrorKind::InvalidData,
"code-mode IPC frame is missing its length prefix",
)
})?;
let length = u32::from_le_bytes(length_bytes) as usize;
if length > MAX_FRAME_BYTES {
return Err(io::Error::new(
io::ErrorKind::InvalidData,
format!("code-mode IPC frame length {length} exceeds {MAX_FRAME_BYTES} bytes"),
));
}
let payload = &bytes[size_of::<u32>()..];
if payload.len() != length {
return Err(io::Error::new(
io::ErrorKind::InvalidData,
format!(
"code-mode IPC frame declares {length} payload bytes but contains {}",
payload.len()
),
));
}
serde_json::from_slice(payload).map_err(|err| {
io::Error::new(View on GitHub (pinned to 339751715c)