From 1f85d4767767266259470755b2b47d726e53c6ab Mon Sep 17 00:00:00 2001 From: lawyzheng Date: Wed, 18 Dec 2024 13:33:23 +0800 Subject: [PATCH] fix get latest step --- skyvern/forge/sdk/db/client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/skyvern/forge/sdk/db/client.py b/skyvern/forge/sdk/db/client.py index ca84b4f60..151e89f61 100644 --- a/skyvern/forge/sdk/db/client.py +++ b/skyvern/forge/sdk/db/client.py @@ -380,6 +380,7 @@ async def get_latest_step(self, task_id: str, organization_id: str | None = None .filter_by(task_id=task_id) .filter_by(organization_id=organization_id) .order_by(StepModel.order.desc()) + .order_by(StepModel.retry_index.desc()) ) ).first(): return convert_to_step(step, debug_enabled=self.debug_enabled)