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 <noreply@anthropic.com>
This commit is contained in:
Krrish Dholakia 2026-05-01 13:43:55 -07:00
parent 7a85c11ad4
commit 3a9aecf236

View file

@ -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: