From 433e30e84fe561ddd2155320f97e3562a7412d1e Mon Sep 17 00:00:00 2001 From: Shuchang Zheng Date: Sat, 7 Sep 2024 16:48:50 -0700 Subject: [PATCH] make task failure log more consistent with 'marking task as failed' (#782) --- skyvern/forge/agent.py | 4 ++-- skyvern/forge/sdk/routes/streaming.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/skyvern/forge/agent.py b/skyvern/forge/agent.py index 04231b69..a1e063d4 100644 --- a/skyvern/forge/agent.py +++ b/skyvern/forge/agent.py @@ -382,7 +382,7 @@ class ForgeAgent: raise except StepTerminationError as e: LOG.warning( - "Step cannot be executed. Task failed.", + "Step cannot be executed, marking task as failed", task_id=task.task_id, step_id=step.step_id, exc_info=True, @@ -442,7 +442,7 @@ class ForgeAgent: return step, detailed_output, None except Exception as e: LOG.exception( - "Got an unexpected exception in step, fail the task", + "Got an unexpected exception in step, marking task as failed", task_id=task.task_id, step_id=step.step_id, ) diff --git a/skyvern/forge/sdk/routes/streaming.py b/skyvern/forge/sdk/routes/streaming.py index ad815788..6bc26bbc 100644 --- a/skyvern/forge/sdk/routes/streaming.py +++ b/skyvern/forge/sdk/routes/streaming.py @@ -104,12 +104,12 @@ async def task_stream( except ValidationError as e: await websocket.send_text(f"Invalid data: {e}") except WebSocketDisconnect: - LOG.info("WebSocket connection closed") + LOG.info("WebSocket connection closed", task_id=task_id, organization_id=organization_id) except ConnectionClosedOK: - LOG.info("ConnectionClosedOK error while streaming", exc_info=True) + LOG.info("ConnectionClosedOK error while streaming", task_id=task_id, organization_id=organization_id) return except Exception: - LOG.warning("Error while streaming", exc_info=True) + LOG.warning("Error while streaming", task_id=task_id, organization_id=organization_id) return - LOG.info("WebSocket connection closed successfully") + LOG.info("WebSocket connection closed successfully", task_id=task_id, organization_id=organization_id) return