openai/codex · error · anyhow::Error

unsupported model item type

Error message

unsupported model item type {item_type} in payload {}

What it means

Validation guard in normalize_model_item: the item's type field is a string but names a kind this reducer does not recognize (not message/function_call/function_call_output/custom_tool_call/compaction etc.). The unknown item_type in the recorded payload is the input at fault.

Solutions

  1. Update the rollout-trace reducer to a version that understands this item type
  2. Fix the producer emitting non-standard item types in model payloads
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

            kind: ConversationItemKind::FunctionCallOutput,
            agent_message: None,
            body: json_body(item, raw_payload),
            call_id: item
                .get("call_id")
                .and_then(Value::as_str)
                .map(ToString::to_string),
        }),
        "compaction" | "compaction_summary" | "context_compaction" => {
            Ok(NormalizedConversationItem {
                role: ConversationRole::Assistant,
                channel: Some(ConversationChannel::Summary),
                kind: ConversationItemKind::Message,
                agent_message: None,
                body: compaction_body(item, raw_payload)?,
                call_id: None,
            })
        }
        _ => bail!(
            "unsupported model item type {item_type} in payload {}",
            raw_payload.raw_payload_id
        ),
    }
}

fn normalize_message_item(
    item: &Value,
    raw_payload: &RawPayloadRef,
) -> Result<NormalizedConversationItem> {
    let Some(role) = item.get("role").and_then(Value::as_str) else {
        bail!(
            "message item in payload {} did not contain a string role",
            raw_payload.raw_payload_id
        );
    };
    let Some(role) = role_from_str(role) else {
        bail!(

View on GitHub (pinned to 339751715c)