openai/codex · error · anyhow::Error

reasoning item in payload

Error message

reasoning item in payload {} contained no content, summary, or encrypted_content

What it means

The reasoning item contained no content, summary, or encrypted_content parts, so the reducer would create an empty reasoning item and rejects it as malformed model output.

Solutions

  1. Ensure reasoning items include at least one of content, summary, or encrypted_content
  2. Skip empty reasoning items gracefully if the model legitimately emits them
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/rollout-trace/src/reducer/conversation/normalize.rs:277 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/9ff76c15624d5ac7. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/rollout-trace/src/reducer/conversation/normalize.rs:277

            Value::Null => None,
            Value::String(encrypted_content) => Some(encrypted_content),
            _ => {
                bail!(
                    "reasoning item in payload {} had non-string encrypted_content",
                    raw_payload.raw_payload_id
                );
            }
        };
        if let Some(encrypted_content) = encrypted_content {
            parts.push(ConversationPart::Encoded {
                label: "encrypted_content".to_string(),
                value: encrypted_content.to_string(),
            });
        }
    }

    if parts.is_empty() {
        bail!(
            "reasoning item in payload {} contained no content, summary, or encrypted_content",
            raw_payload.raw_payload_id
        );
    }

    Ok(NormalizedConversationItem {
        role: ConversationRole::Assistant,
        channel: Some(ConversationChannel::Analysis),
        kind: ConversationItemKind::Reasoning,
        agent_message: None,
        body: ConversationBody { parts },
        call_id: None,
    })
}

#[derive(Clone, Copy)]
enum ReasoningPartKind {
    Content,

View on GitHub (pinned to 339751715c)