From 3a9aecf2368758af102535c100e614b495c1d22c Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Fri, 1 May 2026 13:43:55 -0700 Subject: [PATCH] address greptile review feedback (greploop iteration 9) - Scope report_task_result success path to status='pending' to avoid resetting error counters on terminal-state rows Co-Authored-By: Claude Opus 4.6 --- litellm/proxy/scheduled_tasks/store.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/scheduled_tasks/store.py b/litellm/proxy/scheduled_tasks/store.py index 584368accd4..8fd92643606 100644 --- a/litellm/proxy/scheduled_tasks/store.py +++ b/litellm/proxy/scheduled_tasks/store.py @@ -175,7 +175,11 @@ async def report_task_result( if result == "success": affected = await prisma_client.db.litellm_scheduledtasktable.update_many( - where={"task_id": task_id, "owner_token": owner_token}, + where={ + "task_id": task_id, + "owner_token": owner_token, + "status": "pending", + }, data={"consecutive_errors": 0, "last_error": None}, ) if affected == 0: