{"record":{"id":"c87ce0a544a651cc","repo":"NousResearch/hermes-agent","slug":"codex-responses-input-idx-function-call-output","errorCode":null,"errorMessage":"Codex Responses input[{idx}] function_call_output is missing call_id.","messagePattern":"Codex Responses input\\[(.+?)\\] function_call_output is missing call_id\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/codex_responses_adapter.py","lineNumber":760,"sourceCode":"                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(\n                {\n                    \"type\": \"function_call\",\n                    \"call_id\": call_id.strip(),\n                    \"name\": name.strip(),\n                    \"arguments\": arguments,\n                }\n            )\n            continue\n\n        if item_type == \"function_call_output\":\n            call_id = item.get(\"call_id\")\n            if not isinstance(call_id, str) or not call_id.strip():\n                raise ValueError(f\"Codex Responses input[{idx}] function_call_output is missing call_id.\")\n            output = item.get(\"output\", \"\")\n            if output is None:\n                output = \"\"\n            # Output may be a string OR an array of structured content\n            # items (input_text / input_image) for multimodal tool results.\n            # Both shapes are accepted by the Responses API. We preserve\n            # the array form when present.\n            if isinstance(output, list):\n                # Validate each item is a recognised content shape; drop\n                # anything else to avoid 4xx from the API.\n                cleaned: List[Dict[str, Any]] = []\n                for part in output:\n                    if not isinstance(part, dict):\n                        continue\n                    ptype = part.get(\"type\")\n                    if ptype == \"input_text\":\n                        text = part.get(\"text\")\n                        if isinstance(text, str) and text:","sourceCodeStart":742,"sourceCodeEnd":778,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/agent/codex_responses_adapter.py#L742-L778","documentation":"Error \"Codex Responses input[{idx}] function_call_output is missing call_id.\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at agent/codex_responses_adapter.py:760 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include call_id on every function_call_output item so it pairs with its call.","Repair the history entry whose tool output lost its call_id."],"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"}