Skip to content

remove unreachable error block in thread. streaming path#3290

Open
rmotgi1227 wants to merge 1 commit into
openai:mainfrom
rmotgi1227:fix/streaming-dead-error-check
Open

remove unreachable error block in thread. streaming path#3290
rmotgi1227 wants to merge 1 commit into
openai:mainfrom
rmotgi1227:fix/streaming-dead-error-check

Conversation

@rmotgi1227
Copy link
Copy Markdown

The sse.event == "error" check nested inside startswith("thread.") can never be true — "error" does not start with "thread.". The block was dead code. The else branch already handles error events correctly.

Removes the unreachable block from both sync and async paths.

Fixes #2796

'sse.event == "error"' can never be true inside the 'startswith("thread.")'
branch, so the APIError raise block was dead code. The else branch already
handles error events correctly. Remove the dead block from both sync and async paths.

Fixes openai#2796
@rmotgi1227 rmotgi1227 requested a review from a team as a code owner May 20, 2026 20:05
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