OpenAI Users Report Errors Across Services, Hope for Quick Fix
@Teknium @bradmillscan having erros as well, hope they fix soon
PSA: there seems to be an OpenAI streaming issue plaguing Hermes installs right now. Good news, it can be patched (cc @Teknium)
I've asked Codex to fix and it did, so this IS fixable. If you don't have time to wait until the official repo is patched, heres what you can send your codex agent on the same machine Hermes is installed to patch in the meantime: -----
# Hermes OpenAI Codex fallback fix: `NoneType object is not iterable`
## Symptom
Hermes using OpenAI Codex, usually `gpt-5.5`, starts failing every request with:
`TypeError: 'NoneType' object is not iterable`
Then Hermes activates fallback, often:
`Fallback activated: gpt-5.5 -> grok-4.3 (xai-oauth)`
Check with:
```bash hermes logs errors --since 30m -n 120 hermes logs agent --since 30m -n 160 hermes doctor
If hermes doctor says OpenAI Codex auth is logged in, and logs show the NoneType error on provider=openai- codex, this is probably not an auth failure.
## Cause
OpenAI Codex currently can stream valid response.output_item.done events, but the final response.completed frame may omit response.output. openai-python 2.24.0 then crashes while parsing the final response before Hermes can use the streamed output.
## Fix
Patch agent/codex_runtime.py, inside run_codex_stream, after the existing except RuntimeError as exc: block:
except TypeError as exc: # OpenAI/Codex can stream valid output_item.done frames but omit # response.output on response.completed. openai-python 2.24.0 then # crashes while parsing the completed frame before # get_final_response() returns. Recover from the items/deltas we # already saw instead of incorrectly failing over to another model. err_text = str(exc) if "'NoneType' object is not iterable" not in err_text: raise if collected_output_items: logger.warning( "Codex stream completed without response.output; " "recovering from %d streamed output items. %s", len(collected_output_items), agent._client_log_context(), ) return SimpleNamespace( output=list(collected_output_items), status="completed", model=api_kwargs.get("model"), usage=None, ) if agent._codex_streamed_text_parts and not has_tool_calls: assembled = "".join(agent._codex_streamed_text_parts) logger.warning( "Codex stream completed without response.output; " "recovering from %d text deltas (%d chars). %s", len(agent._codex_streamed_text_parts), len(assembled), agent._client_log_context(), ) return SimpleNamespace( output=[SimpleNamespace( type="message", role="assistant", status="completed", content=[SimpleNamespace(type="output_text", text=assembled)], )], status="completed", model=api_kwargs.get("model"), usage=None, ) raise
SimpleNamespace is already imported at the top of that file in current Hermes.
## Restart
After patching:
hermes gateway restart hermes gateway status
## Update Risk
This local patch can be lost or conflicted on the next hermes update.
Hermes update behavior:
- It stashes local changes before update. - It pulls or resets to origin/main. - It tries to restore the stash afterward. - If the same file changed upstream, stash restore can conflict; Hermes resets the working tree clean and leaves the stash for manual recovery.
Best durable fix: upstream this as a PR to Hermes.
Until then, after every hermes update, verify:
rg "Codex stream completed without response.output" ~/.hermes/hermes-agent/agent/codex_runtime.py python -m pytest tests/run_agent/test_codex_xai_oauth_recovery.py -q hermes gateway restart
If the grep fails, reapply the patch.

@hypertectonic @bradmillscan No - Openai broke their services and now everyone blames hermes for it