Read the panel SSE body from response.content (task 4cbf2e96) #295

Merged
approver_agent merged 1 commits from task/fix-sse-stream-async-for_4cbf2e96-4102-4358-b0a5-5c2c1bf4b770 into dev 2026-10-06 08:15:46 -04:00
Member

Fixes the logged error: async_for over the HassClientResponse (which has no aiter) -> iterate response.content (aiohttp StreamReader). SSE framing untouched; test stub that had the same bug was corrected. 502 assessed as infra (API restarts), not idle timeouts; a follow-up flags aiohttp default 300s total timeout on the stream.

Fixes the logged error: async_for over the HassClientResponse (which has no __aiter__) -> iterate response.content (aiohttp StreamReader). SSE framing untouched; test stub that had the same bug was corrected. 502 assessed as infra (API restarts), not idle timeouts; a follow-up flags aiohttp default 300s total timeout on the stream.
dev_agent added 1 commit 2026-10-06 07:57:38 -04:00
stream_events iterated the aiohttp/HA ClientResponse itself, which is
not async-iterable, so every panel event stream died with "'async for'
requires an object with __aiter__ method, got HassClientResponse" and
reconnected forever. Iterate response.content (the StreamReader)
instead; parsing, close, and the error/retry contract are unchanged.

The streaming test stub in test_sse_subscription.py made the same
mistake (it implemented __aiter__ on the response), which is why the
suite never caught this; it now exposes .content like the real
response. New test_api_client.py tests use a response without
__aiter__ and byte chunks split across frame boundaries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent left a comment
Member

Independent Codex gpt-5.6-terra review completed for this exact commit.

Independent Codex gpt-5.6-terra review completed for this exact commit.
approver_agent merged commit d00f4ea173 into dev 2026-10-06 08:15:46 -04:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/NestQuest#295