Skip to content

fix: remove unreachable streaming error branch#3461

Open
nightcityblade wants to merge 1 commit into
openai:mainfrom
nightcityblade:fix/issue-2796
Open

fix: remove unreachable streaming error branch#3461
nightcityblade wants to merge 1 commit into
openai:mainfrom
nightcityblade:fix/issue-2796

Conversation

@nightcityblade

Copy link
Copy Markdown
  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

Fixes #2796.

This removes the unreachable sse.event == "error" branch nested under the thread. event path in both sync and async streaming helpers.

I also added focused streaming tests to lock in the current intended behavior:

  • thread.* events keep their {data, event} wrapper
  • plain error events still raise APIError

Additional context & links

Validation run locally:

  • uv run ruff check src/openai/_streaming.py tests/test_streaming.py
  • uv run pytest tests/test_streaming.py -q

@nightcityblade nightcityblade requested a review from a team as a code owner July 1, 2026 15:12
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.

Bug: Dead code - sse.event == "error" check is unreachable in _streaming.py

1 participant