diff --git a/letta/server/rest_api/streaming_response.py b/letta/server/rest_api/streaming_response.py index 4cfe9819..361facff 100644 --- a/letta/server/rest_api/streaming_response.py +++ b/letta/server/rest_api/streaming_response.py @@ -332,5 +332,5 @@ class StreamingResponseWithStatusCode(StreamingResponse): ) capture_sentry_exception(exc) return - if more_body: + if more_body and self._client_connected: await send({"type": "http.response.body", "body": b"", "more_body": False})