Skip to content

fix: handle None response.output in parse_response - #3357

Closed
samsameer2804-cloud wants to merge 3 commits into
openai:mainfrom
samsameer2804-cloud:main
Closed

fix: handle None response.output in parse_response#3357
samsameer2804-cloud wants to merge 3 commits into
openai:mainfrom
samsameer2804-cloud:main

Conversation

@samsameer2804-cloud

Copy link
Copy Markdown

Summary

parse_response() crashes with a TypeError when response.output
is None instead of a list.

Fix

Changed the iteration to use (response.output or []) so it safely
handles None by treating it as an empty list.

Fixes #3325

@samsameer2804-cloud
samsameer2804-cloud requested a review from a team as a code owner June 3, 2026 05:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 50e2b09a76

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/openai/lib/_parsing/_responses.py Outdated
@marcuswood-oai

Copy link
Copy Markdown
Contributor

Thank you for the contribution! The null-output parsing and stream recovery fix has landed in #3345, so I am closing this PR as superseded. We appreciate your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

parse_response crashes with TypeError when response.output is null in response.completed event (chatgpt.com Codex backend)

2 participants