{"record":{"id":"581b1d274a0b7056","repo":"NousResearch/hermes-agent","slug":"codex-responses-input-idx-must-be-an-object","errorCode":null,"errorMessage":"Codex Responses input[{idx}] must be an object.","messagePattern":"Codex Responses input\\[(.+?)\\] must be an object\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/codex_responses_adapter.py","lineNumber":729,"sourceCode":"def _preflight_codex_input_items(\n    raw_items: Any,\n    *,\n    is_github_responses: bool = False,\n    sanitize_harmony_tokens: bool = False,\n) -> List[Dict[str, Any]]:\n    if not isinstance(raw_items, list):\n        raise ValueError(\"Codex Responses input must be a list of input items.\")\n\n    sanitize_text = (\n        _neutralize_harmony_tokens\n        if sanitize_harmony_tokens\n        else lambda text: text\n    )\n    normalized: List[Dict[str, Any]] = []\n    seen_ids: set = set()\n    for idx, item in enumerate(raw_items):\n        if not isinstance(item, dict):\n            raise ValueError(f\"Codex Responses input[{idx}] must be an object.\")\n\n        item_type = item.get(\"type\")\n        if item_type == \"function_call\":\n            call_id = item.get(\"call_id\")\n            name = item.get(\"name\")\n            if not isinstance(call_id, str) or not call_id.strip():\n                raise ValueError(f\"Codex Responses input[{idx}] function_call is missing call_id.\")\n            if not isinstance(name, str) or not name.strip():\n                raise ValueError(f\"Codex Responses input[{idx}] function_call is missing name.\")\n\n            arguments = item.get(\"arguments\", \"{}\")\n            if isinstance(arguments, dict):\n                arguments = json.dumps(arguments, ensure_ascii=False)\n            elif not isinstance(arguments, str):\n                arguments = str(arguments)\n            arguments = sanitize_text(arguments.strip() or \"{}\")\n\n            normalized.append(","sourceCodeStart":711,"sourceCodeEnd":747,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/agent/codex_responses_adapter.py#L711-L747","documentation":"Error \"Codex Responses input[{idx}] must be an object.\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at agent/codex_responses_adapter.py:729 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure every item in the Responses input list is an object.","Fix the message conversion that produced a scalar input item."],"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"}