Skip to content

Remove unreachable SSE error branch - #3790

Open
LOGO127 wants to merge 1 commit into
openai:mainfrom
LOGO127:codex/openai-2796-streaming-dead-code
Open

Remove unreachable SSE error branch#3790
LOGO127 wants to merge 1 commit into
openai:mainfrom
LOGO127:codex/openai-2796-streaming-dead-code

Conversation

@LOGO127

@LOGO127 LOGO127 commented Sep 3, 2026

Copy link
Copy Markdown

Summary

  • Remove the unreachable sse.event == "error" checks nested under the thread. event branch in both Stream and AsyncStream.
  • Preserve the existing reachable error handling for non-thread. SSE payloads.

Closes #2796

Tests

  • pytest -o addopts='' tests/test_streaming.py -q (20 passed)
  • ruff check src/openai/_streaming.py
  • ruff format --check src/openai/_streaming.py
  • git diff --check

Signed-off-by: luozijian <luozijian0924@gamil.com>
@LOGO127

LOGO127 commented Sep 3, 2026

Copy link
Copy Markdown
Author

Maintainers, this PR intentionally keeps the diff to 28 deleted lines and leaves the reachable SSE error handling unchanged. The focused streaming tests and Ruff checks pass. Happy to adjust if the repository prefers an additional regression test.

@LOGO127

LOGO127 commented Sep 3, 2026

Copy link
Copy Markdown
Author

@openai/sdks-team, could a code-owner reviewer take a look when convenient? This PR removes only the duplicated unreachable error branch under thread.*; the focused streaming tests and Ruff checks pass. Happy to adapt if the SDK team prefers a regression test or a different cleanup scope.

@sylvesterkaczmarek sylvesterkaczmarek 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.

Correct cleanup. sse.event == "error" is unreachable under the thread. prefix branch, while the non-thread path still owns SSE error propagation. Removing both sync and async copies reduces misleading dead logic without changing event semantics.

@LOGO127

LOGO127 commented Sep 4, 2026

Copy link
Copy Markdown
Author

Thanks for confirming the event semantics. No code changes are needed from this review. @openai/sdks-team, could a code-owner maintainer record the formal approval when convenient?

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

2 participants