Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
Warn ConnectionClosedError in websocket/streaming (#3760)
Stanislav Novosad441f46ab5ce3
diff --git a/skyvern/forge/sdk/routes/streaming.py b/skyvern/forge/sdk/routes/streaming.pyindex 302ff5c33..76a576ef4 100644--- a/skyvern/forge/sdk/routes/streaming.py+++ b/skyvern/forge/sdk/routes/streaming.py@@ -5,7 +5,7 @@ from datetime import datetimeimport structlogfrom fastapi import WebSocket, WebSocketDisconnectfrom pydantic import ValidationError-from websockets.exceptions import ConnectionClosedOK+from websockets.exceptions import ConnectionClosedError, ConnectionClosedOKfrom skyvern.forge import appfrom skyvern.forge.sdk.routes.routers import legacy_base_router@@ -112,6 +112,13 @@ async def task_stream(except ConnectionClosedOK:LOG.info("ConnectionClosedOK error while streaming", task_id=task_id, organization_id=organization_id)return+ except ConnectionClosedError:+ LOG.warning(+ "ConnectionClosedError while streaming (client likely disconnected)",+ task_id=task_id,+ organization_id=organization_id,+ )+ returnexcept Exception:LOG.warning("Error while streaming", task_id=task_id, organization_id=organization_id, exc_info=True)return@@ -237,6 +244,13 @@ async def workflow_run_streaming(organization_id=organization_id,)return+ except ConnectionClosedError:+ LOG.warning(+ "WofklowRun Streaming: ConnectionClosedError while streaming (client likely disconnected)",+ workflow_run_id=workflow_run_id,+ organization_id=organization_id,+ )+ returnexcept Exception:LOG.warning("WofklowRun Streaming: Error while streaming",