diff --git a/src/pipecat/services/websocket_service.py b/src/pipecat/services/websocket_service.py index 17a9113667..87a63e7dc1 100644 --- a/src/pipecat/services/websocket_service.py +++ b/src/pipecat/services/websocket_service.py @@ -83,6 +83,9 @@ async def _receive_task_handler(self, report_error: Callable[[ErrorFrame], Await try: await self._receive_messages() retry_count = 0 # Reset counter on successful message receive + except asyncio.CancelledError: + logger.debug(f"{self} receive task cancelled") + break except ConnectionClosedOK as e: # Normal closure, don't retry logger.debug(f"{self} connection closed normally: {e}")