NousResearch/hermes-agent · error · ValueError

Codex Responses input[{idx}] message content[{part_idx}] mus

Error message

Codex Responses input[{idx}] message content[{part_idx}] must be an object.

What it means

Error "Codex Responses input[{idx}] message content[{part_idx}] must be an object." thrown in NousResearch/hermes-agent.

Source

Thrown at agent/codex_responses_adapter.py:857

            # only the fields the API defines.
            encrypted = item.get("encrypted_content")
            if isinstance(encrypted, str) and encrypted:
                normalized.append(
                    {"type": "compaction", "encrypted_content": encrypted}
                )
            continue

        if item_type == "message":
            role = item.get("role")
            if role != "assistant":
                raise ValueError(f"Codex Responses input[{idx}] message items must have role='assistant'.")
            content = item.get("content")
            if not isinstance(content, list):
                raise ValueError(f"Codex Responses input[{idx}] message item must have content list.")
            normalized_content = []
            for part_idx, part in enumerate(content):
                if not isinstance(part, dict):
                    raise ValueError(
                        f"Codex Responses input[{idx}] message content[{part_idx}] must be an object."
                    )
                part_type = part.get("type")
                if part_type not in {"output_text", "text"}:
                    raise ValueError(
                        f"Codex Responses input[{idx}] message content[{part_idx}] has unsupported type {part_type!r}."
                    )
                text = part.get("text", "")
                if text is None:
                    text = ""
                if not isinstance(text, str):
                    text = str(text)
                normalized_content.append({"type": "output_text", "text": sanitize_text(text)})
            if not normalized_content:
                raise ValueError(f"Codex Responses input[{idx}] message item must contain at least one text part.")
            normalized_item: Dict[str, Any] = {
                "type": "message",
                "role": "assistant",

View on GitHub (pinned to c896c09c42)

Solutions

  1. Ensure each message content part is an object with a valid type.
  2. Fix the conversion that emitted a scalar or malformed content part.

When it happens

Trigger: Thrown at agent/codex_responses_adapter.py:857 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14). Data as JSON: /api/errors/55cef8c0391d4135. Report an issue: GitHub.