GlobalRouter.stream() and stream_async() send requests with stream=True, then pass 4xx/5xx responses directly to error_from_response(). For a real streaming response body, error_from_response() calls response.json()/response.text before the body has been read, so httpx raises ResponseNotRead instead of the SDK's documented GlobalRouterError. Reproduce with a MockTransport returning httpx.Response(400, stream=httpx.ByteStream(b'{"error":{"message":"bad"}}')) and then iterating client.chat.stream(...). Read the response content before normalization, or handle streaming error bodies separately.
File: src/globalrouter/_client.py
Line: 214
Severity: medium
Summary: unread streaming errors in globalrouter.stream
GlobalRouter.stream()andstream_async()send requests withstream=True, then pass 4xx/5xx responses directly toerror_from_response(). For a real streaming response body,error_from_response()callsresponse.json()/response.textbefore the body has been read, so httpx raisesResponseNotReadinstead of the SDK's documentedGlobalRouterError. Reproduce with a MockTransport returninghttpx.Response(400, stream=httpx.ByteStream(b'{"error":{"message":"bad"}}'))and then iteratingclient.chat.stream(...). Read the response content before normalization, or handle streaming error bodies separately.File:
src/globalrouter/_client.pyLine: 214
Severity: medium
Summary: unread streaming errors in globalrouter.stream