{"record":{"id":"ec1c2fb7dc972cb0","repo":"NousResearch/hermes-agent","slug":"codex-responses-stream-did-not-emit-a-terminal-res","errorCode":null,"errorMessage":"Codex Responses stream did not emit a terminal response","messagePattern":"Codex Responses stream did not emit a terminal response","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"agent/codex_runtime.py","lineNumber":1286,"sourceCode":"    elif collected_text_deltas and not has_tool_calls:\n        assembled = \"\".join(collected_text_deltas)\n        output = [SimpleNamespace(\n            type=\"message\",\n            role=\"assistant\",\n            status=\"completed\",\n            content=[SimpleNamespace(type=\"output_text\", text=assembled)],\n        )]\n    else:\n        output = []\n\n    # If the stream ended without any terminal event AND produced no usable\n    # content (no items, no text deltas), surface that as a RuntimeError so\n    # callers can distinguish \"stream truncated mid-flight / provider rejected\n    # the call\" from \"stream completed with empty body\".  This preserves the\n    # signal the SDK's high-level helper used to raise as\n    # ``RuntimeError(\"Didn't receive a `response.completed` event.\")``.\n    if not saw_terminal and not output:\n        raise RuntimeError(\n            \"Codex Responses stream did not emit a terminal response\"\n        )\n\n    assembled_text = \"\".join(collected_text_deltas)\n\n    final = SimpleNamespace(\n        output=output,\n        output_text=assembled_text,\n        usage=terminal_usage,\n        status=terminal_status,\n        id=terminal_response_id,\n        model=model,\n        incomplete_details=terminal_incomplete_details,\n        error=terminal_error,\n    )\n    return final\n\n","sourceCodeStart":1268,"sourceCodeEnd":1304,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/agent/codex_runtime.py#L1268-L1304","documentation":"Error \"Codex Responses stream did not emit a terminal response\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at agent/codex_runtime.py:1286 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the call; the stream closed without a terminal response event.","Check network/proxy stability for long-lived streams to the provider.","Inspect provider logs for a dropped or errored stream."],"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"}