Remove unreachable SSE error branch - #3790
Conversation
Signed-off-by: luozijian <luozijian0924@gamil.com>
|
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. |
|
@openai/sdks-team, could a code-owner reviewer take a look when convenient? This PR removes only the duplicated unreachable error branch under |
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
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.
|
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? |
Summary
sse.event == "error"checks nested under thethread.event branch in bothStreamandAsyncStream.thread.SSE payloads.Closes #2796
Tests
pytest -o addopts='' tests/test_streaming.py -q(20 passed)ruff check src/openai/_streaming.pyruff format --check src/openai/_streaming.pygit diff --check