Merge remote-tracking branch 'federicorao/codex/issue-762-1781265706'
Some checks failed
CI / Tests (push) Has been cancelled
CI / Pre-commit (push) Has been cancelled
CI / Snapshot Tests (push) Has been cancelled

This commit is contained in:
Carl Philipp Klemm 2026-07-02 13:07:43 +02:00
commit 1517fcb405

View file

@ -411,7 +411,11 @@ class GenericBackend:
await response.aread() await response.aread()
response.raise_for_status() response.raise_for_status()
async for line in iter_sse_lines(response): async for line in iter_sse_lines(response):
if line.strip() == "": stripped = line.strip()
# Skip blank lines and SSE comment lines: per the SSE spec any
# line beginning with ":" is a comment (e.g. keep-alive
# heartbeats), so ignore them instead of raising below.
if stripped == "" or stripped.startswith(":"):
continue continue
DELIM_CHAR = ":" DELIM_CHAR = ":"