Bug
parse_response() in openai/lib/_parsing/_responses.py:61 crashes with TypeError: 'NoneType' object is not iterable when response.output is null.
# Line 61 — no null guard
for output in response.output: # crashes when output is None
Reproduction
When streaming via the ChatGPT Codex backend (chatgpt.com/backend-api/codex) with model gpt-5.5, the response.completed SSE event contains output: null instead of an empty list. The SDK's stream accumulator calls accumulate_event() → parse_response() which iterates response.output without checking for None.
Affected versions: Tested 2.24.0, 2.25.0, 2.30.0, 2.38.0 — all have the same unguarded loop.
Stack trace:
File "openai/lib/streaming/responses/_responses.py", line 360, in accumulate_event
self._completed_response = parse_response(...)
File "openai/lib/_parsing/_responses.py", line 61, in parse_response
for output in response.output:
TypeError: 'NoneType' object is not iterable
Fix
# Line 61
for output in (response.output or []):
Environment
- OpenAI Python SDK: 2.24.0–2.38.0
- Python: 3.11.15
- Provider: openai-codex (chatgpt.com/backend-api/codex)
- Model: gpt-5.5
- Client: Hermes Agent v0.14.0
Bug
parse_response()inopenai/lib/_parsing/_responses.py:61crashes withTypeError: 'NoneType' object is not iterablewhenresponse.outputisnull.Reproduction
When streaming via the ChatGPT Codex backend (
chatgpt.com/backend-api/codex) with modelgpt-5.5, theresponse.completedSSE event containsoutput: nullinstead of an empty list. The SDK's stream accumulator callsaccumulate_event()→parse_response()which iteratesresponse.outputwithout checking forNone.Affected versions: Tested 2.24.0, 2.25.0, 2.30.0, 2.38.0 — all have the same unguarded loop.
Stack trace:
Fix
Environment