mirror of
https://github.com/Comfy-Org/comfy-python-sdk.git
synced 2026-11-04 23:37:47 +00:00
[PR #223] fix: ignore a leading BOM in SSE streams #223
Labels
No labels
audit:ai-readiness
audit:community
audit:github
audit:health-scoring
audit:policy
audit:release
audit:supply-chain
effort:medium
effort:small
effort:small
effort:trivial
priority:nice-to-have
priority:nice-to-have
priority:recommended
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-python-sdk#223
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-python-sdk/pull/223
Author: @allenflux
Created: 10/17/2026
Status: 🔄 Open
Base:
main← Head:fix-sse-leading-bom📝 Commits (1)
204f8edfix: ignore a leading BOM in SSE streams📊 Changes
4 files changed (+140 additions, -0 deletions)
View changed files
📝
CHANGELOG.md(+5 -0)📝
src/comfy_low/sse.py(+5 -0)📝
tests/conftest.py(+17 -0)➕
tests/test_sse_bom.py(+113 -0)📄 Description
A valid SSE stream can begin with one UTF-8 byte order mark. The decoder currently treats it as part of the first field name: an initial
event:loses its event type, and an initialdata:can lose the entire frame. The WHATWG parsing rules require removing one leading BOM.Remove exactly one prefix on the shared decoder's first line, including when that line is a comment or blank. Later marks remain intact. Each HTTP connection already creates its own decoder, so the same rule applies after reconnecting.
The regressions cover decoder boundaries and real sync/async HTTP streams, splitting the BOM bytes and CRLF pairs across chunks. Reconnect tests verify that typed progress and terminal events survive both connections.
Validation on Python 3.12.11 / macOS:
pytest -v: 1286 passed, 9 environment-gated live integration tests skipped.mypy src, codegen drift, public repository hygiene, wheel/sdist build, andtwine check: pass.This protocol-conformance case was reproduced with the repository's local HTTP server. The Python 3.10–3.13 runtime matrix remains for CI. No version or dependency update is needed.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.