You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: pass max_line_length to readline() to prevent LineTooLong on large SSE lines with MTLS.
When using AsyncAuthorizedSession (Vertex AI + ADC), the google-auth library
creates its own internal aiohttp.ClientSession with the default
read_bufsize=2**16. This gives the underlying StreamReader a _high_water of
131072 bytes, which is the effective limit for readline().
Streaming responses from thinking models can include large thoughtSignature
fields, or generated images, that push a single SSE data: line beyond 131072 bytes, causing aiohttp to raise LineTooLong.
The fix passes max_line_length=READ_BUFFER_SIZE (4MB) explicitly to every
readline() call in _aiter_response_stream(), overriding the limit regardless
of which code path created the underlying session. This covers both the direct
AiohttpClientSession path (API key auth) and the AsyncAuthorizedSession path
(Vertex AI + ADC).
Test: added test_aiohttp_large_sse_line_with_thought_signature which uses a
mock that enforces the real aiohttp LineTooLong limit, and streams a 150KB SSE
line that would previously fail. Manually verified, this test fails before the change.
PiperOrigin-RevId: 916020090
* Migrate Agent Engines, Evaluation, Prompt Management, and Skill features to agentplatform ([abb1099](https://github.com/googleapis/python-genai/commit/abb1099fab3fc227acf53f3cdcd51a87679a51fe))
11
-
12
-
13
-
### Documentation
14
-
15
-
* Refresh generated docs for 2.2 ([2ce0298](https://github.com/googleapis/python-genai/commit/2ce02983753b1a0b4f7f5068b17996081e378b09))
0 commit comments