{"record":{"id":"00ac4d92ffe446ff","repo":"NousResearch/hermes-agent","slug":"codex-responses-input-idx-content-part-idx-m","errorCode":null,"errorMessage":"Codex Responses input[{idx}].content[{part_idx}] must be an object or string.","messagePattern":"Codex Responses input\\[(.+?)\\]\\.content\\[(.+?)\\] must be an object or string\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/codex_responses_adapter.py","lineNumber":913,"sourceCode":"        if role in {\"user\", \"assistant\"}:\n            content = item.get(\"content\", \"\")\n            if content is None:\n                content = \"\"\n            if isinstance(content, list):\n                # Multimodal content from ``_chat_messages_to_responses_input``\n                # is already in Responses format (``input_text`` / ``output_text``\n                # / ``input_image``).  Validate each part and pass through.\n                # Use the correct text type for the role — ``output_text`` for\n                # assistant messages, ``input_text`` for user messages.\n                text_type = \"output_text\" if role == \"assistant\" else \"input_text\"\n                validated: List[Dict[str, Any]] = []\n                for part_idx, part in enumerate(content):\n                    if isinstance(part, str):\n                        if part:\n                            validated.append({\"type\": text_type, \"text\": sanitize_text(part)})\n                        continue\n                    if not isinstance(part, dict):\n                        raise ValueError(\n                            f\"Codex Responses input[{idx}].content[{part_idx}] must be an object or string.\"\n                        )\n                    ptype = str(part.get(\"type\") or \"\").strip().lower()\n                    if ptype in {\"input_text\", \"text\", \"output_text\"}:\n                        text = part.get(\"text\", \"\")\n                        if not isinstance(text, str):\n                            text = str(text or \"\")\n                        validated.append({\"type\": text_type, \"text\": sanitize_text(text)})\n                    elif ptype in {\"input_image\", \"image_url\"}:\n                        image_ref = part.get(\"image_url\", \"\")\n                        detail = part.get(\"detail\")\n                        if isinstance(image_ref, dict):\n                            url = image_ref.get(\"url\", \"\")\n                            detail = image_ref.get(\"detail\", detail)\n                        else:\n                            url = image_ref\n                        if not isinstance(url, str):\n                            url = str(url or \"\")","sourceCodeStart":895,"sourceCodeEnd":931,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/agent/codex_responses_adapter.py#L895-L931","documentation":"Error \"Codex Responses input[{idx}].content[{part_idx}] must be an object or string.\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at agent/codex_responses_adapter.py:913 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Emit content parts as objects or strings only.","Fix the conversion that produced a non-object, non-string content part."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}