Skip to content

fix(openai): surface failed response streams#228

Open
EfeDurmaz16 wants to merge 1 commit into
vercel-labs:mainfrom
EfeDurmaz16:fix/openai-response-failed
Open

fix(openai): surface failed response streams#228
EfeDurmaz16 wants to merge 1 commit into
vercel-labs:mainfrom
EfeDurmaz16:fix/openai-response-failed

Conversation

@EfeDurmaz16

Copy link
Copy Markdown

What

Raise ProviderResponseError when the OpenAI Responses API emits response.failed. Preserve the provider error message, code, body, and retryability signal.

Why

response.failed is a terminal provider failure, but the adapter currently continues and emits a normal StreamEnd. Applications can therefore persist partial output as a successful completion.

How

  • Convert the official response error payload into ProviderResponseError.
  • Mark rate_limit_exceeded, server_error, and vector_store_timeout as retryable.
  • Keep already streamed partial output available to the caller while raising.

OpenAI event reference: https://platform.openai.com/docs/api-reference/responses-streaming/response/failed

Verification

  • uv run --frozen pytest -q: 594 passed
  • Ruff format and lint passed
  • mypy passed
  • ty passed

Suggested release label: fix.

@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

@EfeDurmaz16 is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant