Skip to content

Exception creation, new testing, raising exception in retrieve, Fixes #3212 - #3723

Open
alextemn wants to merge 2 commits into
openai:mainfrom
alextemn:feat/responses-background-failure-exceptions
Open

Exception creation, new testing, raising exception in retrieve, Fixes #3212#3723
alextemn wants to merge 2 commits into
openai:mainfrom
alextemn:feat/responses-background-failure-exceptions

Conversation

@alextemn

@alextemn alextemn commented Aug 23, 2026

Copy link
Copy Markdown

Changes being requested

-Adding response error to exception class mapping for async calls
-Creating exception from error response
-Raising an exception when status is "failed" or "incomplete"

What to keep in mind

  • Async jobs still return 200s, but we return appropriate exceptions
  • If we want status codes to return the appropriate code, we'd need to make other, more upstream changes
  • It also seems like synchronous jobs have the same issue of only returning 200s, since the server still gets back to us that there was an error, but I'm unsure if appropriate exceptions are raised, or if thats needed. I can open a new issue on this if needed

Additional context & links

#3212
fixes #3212

@alextemn
alextemn requested a review from a team as a code owner August 23, 2026 16:22
@alextemn alextemn changed the title Exception creation, new testing, raising exception in retrieve Exception creation, new testing, raising exception in retrieve, Fixes #3212 Aug 23, 2026

@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: 76bd1aaaf6

ℹ️ 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/_responses.py Outdated
Comment thread src/openai/lib/_responses.py
Comment thread src/openai/lib/__init__.py
Comment thread src/openai/lib/_responses.py
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.

Background responses failures lack a stable code/name that maps to an exception class

1 participant