From a6926b80283bbe855bb617be0dbdbaa9968f62f8 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sun, 8 Mar 2026 21:45:11 +0000 Subject: fix: retry limits apply only to automatic retries, not manual runs Remove the MaxAttempts check from POST /api/tasks/{id}/run. A user explicitly triggering a run is a manual action and should not be gated by the retry limit. Retry limits will be enforced in the (future) automatic retry path. Co-Authored-By: Claude Sonnet 4.6 --- internal/api/server.go | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'internal/api/server.go') diff --git a/internal/api/server.go b/internal/api/server.go index 34e1872..11c9c15 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -451,21 +451,6 @@ func (s *Server) handleRunTask(w http.ResponseWriter, r *http.Request) { return } - // Enforce retry limit for non-initial runs (PENDING is the initial state). - if t.State != task.StatePending { - execs, err := s.store.ListExecutions(id) - if err != nil { - writeJSON(w, http.StatusInternalServerError, map[string]string{"error": "failed to count executions"}) - return - } - if t.Retry.MaxAttempts > 0 && len(execs) >= t.Retry.MaxAttempts { - writeJSON(w, http.StatusConflict, map[string]string{ - "error": fmt.Sprintf("retry limit reached (%d/%d attempts used)", len(execs), t.Retry.MaxAttempts), - }) - return - } - } - if err := s.store.UpdateTaskState(id, task.StateQueued); err != nil { writeJSON(w, http.StatusInternalServerError, map[string]string{"error": err.Error()}) return -- cgit v1.2.3