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.
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>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.
Independent Codex gpt-5.6-terra review completed for this exact commit.