From a6fec7b28254ebb7c1a816479bdff8498f5ae4b3 Mon Sep 17 00:00:00 2001 From: LawyZheng Date: Wed, 18 Dec 2024 13:35:42 +0800 Subject: [PATCH] fix get latest step (#1412) --- 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)