d": "RM_Dr8ZtnQZi7Ww", "timestamp": "2026-02-24T15...
# ask-ai
c
d": "RM_Dr8ZtnQZi7Ww", "timestamp": "2026-02-24T152643.299333+00:00"} {"message": "Error in send task: Cannot write to closing transport\nTraceback (most recent call last):\n File \"/home/ubuntu/algotalks/DynamicContextAgent/.venv/lib/python3.12/site-packages/livekit/plugins/sarvam/tts.py\", line 714, in send_task\n await ws.send_str(json.dumps(config_msg))\n File \"/home/ubuntu/algotalks/DynamicContextAgent/.venv/lib/python3.12/site-packages/aiohttp/client_ws.py\", line 245, in send_str\n await self._writer.send_frame(\n File \"/home/ubuntu/algotalks/DynamicContextAgent/.venv/lib/python3.12/site-packages/aiohttp/_websocket/writer.py\", line 83, in send_frame\n self._write_websocket_frame(message, opcode, 0)\n File \"/home/ubuntu/algotalks/DynamicContextAgent/.venv/lib/python3.12/site-packages/aiohttp/_websocket/writer.py\", line 151, in _write_websocket_frame\n raise ClientConnectionResetError(\"Cannot write to closing transport\")\naiohttp.client_exceptions.ClientConnectionResetError: Cannot write to closing transport", "level": "ERROR", "name": "livekit.plugins.sarvam.log", "exc_info": "Traceback (most recent call last):\n File \"/home/ubuntu/algotalks/DynamicContextAgent/.venv/lib/python3.12/site-packages/livekit/plugins/sarvam/tts.py\", line 714, in send_task\n await ws.send_str(json.dumps(config_msg))\n File \"/home/ubuntu/algotalks/DynamicContextAgent/.venv/lib/python3.12/site-packages/aiohttp/client_ws.py\", line 245, in send_str\n await self._writer.send_frame(\n File \"/home/ubuntu/algotalks/DynamicContextAgent/.venv/lib/python3.12/site-packages/aiohttp/_websocket/writer.py\", line 83, in send_frame\n self._write_websocket_frame(message, opcode, 0)\n File \"/home/ubuntu/algotalks/DynamicContextAgent/.venv/lib/python3.12/site-packages/aiohttp/_websocket/writer.py\", line 151, in _write_websocket_frame\n raise ClientConnectionResetError(\"Cannot write to closing transport\")\naiohttp.client_exceptions.ClientConnectionResetError: Cannot write to closing transport", "session_id": 138374040272048, "connection_state": "connected", "model": "bulbul:v2", "speaker": "anushka", "client_request_id": "12840c7fe812", "server_request_id": null, "room": "ivr-saurabh-1771946728", "pid": 157960, "job_id": "AJ_xCeYW4NuwBUt", "room_id": "RM_Dr8ZtnQZi7Ww", "timestamp": "2026-02-24T152643.299491+00:00"} {"message": "Error in receive task: Cannot write to closing transport\nTraceback (most recent call last):\n -packages/livekit/plugins/sarvam/tts.py\", line 736, in send_task\n raise APIConnectionError(f\"Send task failed: {e}\") from e\nlivekit.agents._exceptions.APIConnectionError: Send task failed: Cannot write to closing transport", "level": "ERROR", "name": "livekit.plugins.sarvam.log", "exc_info": "Traceback (most recent call last):\n File \"/home/ubuntu/algotalks/DynamicContextAgent/.venv/lib/python3.12/site-packages/livekit/plugins/sarvam/tts.py\", line 714, in send_task\n await ws.send_str(json.dumps(config_msg))\n File \"/home/ubuntu/algotalks/DynamicContextAgent/.venv/lib/python3.12/site-packages/aiohttp/client_ws.py\", line 245, in send_str\n await self._writer.send_frame(\n File \"/home/ubuntu/algotalks/DynamicContextAgent/.venv/lib/python3.12/site-packages/aiohttp/_websocket/writer.py\", line 83, in send_frame\n self._write_websocket_frame(message, opcode, 0)\n File \"/home/ubuntu/algotalks/DynamicContextAgent/.venv/lib/python3.12/site-packages/aiohttp/_websocket/writer.py\", line 151, in _write_websocket_frame\n raise ClientConnectionResetError(\"Cannot write to closing transport\")\naiohttp.client_exceptions.ClientConnectionResetError: Cannot write to closing transport\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/home/ubuntu/algotalks/DynamicContextAgent/.venv/lib/python3.12/site-packages/livekit/plugins/sarvam/tts.py\", line 786, in _run_ws\n await asyncio.gather(*tasks)\n File \"/home/ubuntu/algotalks/DynamicContextAgent/.venv/lib/python3.12/site-packages/livekit/plugins/sarvam/tts.py\", line 736, in send_task\n raise APIConnectionError(f\"Send task failed: {e}\") from e\nlivekit.agents._exceptions.APIConnectionError: Send task failed: Cannot write to closing transport", "session_id": 138374040272048, "connection_state": "failed", "model": "bulbul:v2", "speaker": "anushka", "client_request_id": "12840c7fe812", "server_request_id": null, "room": "ivr-saurabh-1771946728", "pid": 157960, "job_id": "AJ_xCeYW4NuwBUt", "room_id": "RM_Dr8ZtnQZi7Ww", "timestamp": "2026-02-24T152643.302968+00:00"} {"message": "failed to synthesize speech: Connection error., retrying in 0.1s", "level": "WARNING", "name": "livekit.agents", "tts": "livekit.plugins.sarvam.tts.TTS", "attempt": 1, "streamed": true, "room": "ivr-saurabh-1771946728", "pid": 157960, "job_id": "AJ_xCeYW4NuwBUt", "room_id": "RM_Dr8ZtnQZi7Ww", "timestamp": "2026-02-24T152643.307817+00:00"} {"message": "Starting TTS WebSocket session", "level": "INFO", "name": "livekit.plugins.sarvam.log", "session_id": 138374040272048, "connection_state": "disconnected", "model": "bulbul:v2", "speaker": "anushka", "client_request_id": "407335089cf3", "server_request_id": null, "room": "ivr-saurabh-1771946728", "pid": 157960, "job_id": "AJ_xCeYW4NuwBUt", "room_id": "RM_Dr8ZtnQZi7Ww", "timestamp": "2026-02-24T152643.408803+00:00"} {"message": "Connecting to Sarvam TTS WebSocket", "level": "INFO", "name": "livekit.plugins.sarvam.log", "room": "ivr-saurabh-1771946728", "pid": 157960, "job_id": "AJ_xCeYW4NuwBUt", "room_id": "RM_Dr8ZtnQZi7Ww", "timestamp": "2026-02-24T152643.409071+00:00"} {"message": "WebSocket connected successfully", "level": "INFO", "name": "livekit.plugins.sarvam.log", "session_id": 138374040272048, "connection_state": "connected", "model": "bulbul:v2", "speaker": "anushka", "client_request_id": "407335089cf3", "server_request_id": null, "room": "ivr-saurabh-1771946728", "pid": 157960, "job_id": "AJ_xCeYW4NuwBUt", "room_id": "RM_Dr8ZtnQZi7Ww", "timestamp": "2026-02-24T152643.463636+00:00"} {"message": "WebSocket session completed successfully", "level": "INFO", "name": "livekit.plugins.sarvam.log", "session_id": 138374040272048, "connection_state": "connected", "model": "bulbul:v2", "speaker": "anushka", "client_request_id": "407335089cf3", "server_request_id": "20260224_5d769666-bca6-4eac-98ac-5a5e57cc15b1", "room": "ivr-saurabh-1771946728", "pid": 157960, "job_id": "AJ_xCeYW4NuwBUt", "room_id": "RM_Dr8ZtnQZi7Ww", "timestamp": "2026-02-24T152643.903677+00:00"} 2026-02-24 152653,553 | INFO | call_AJ_xCeYW | Tool called: submit_survey_answer with response=graduation I am constantly getting this error whenever I make concurrent calls on my IVR. Kindly provide me with a valid solution