From 25cf4c9d4d6f3c18ee7565bf8e6172896fff00c3 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sat, 4 Apr 2026 21:59:58 +0000 Subject: fix: prevent SHIPPABLE stories and wrong READY state on failed tasks Three related bugs fixed: 1. maybeUnblockParent: guard against promoting QUEUED leaf tasks (no subtasks) to READY. The vacuously-true 'all subtasks done' check was advancing tasks that stalled in QUEUED (due to a prior SQLite lock error) to READY on server restart via RecoverStaleBlocked, despite having only failed executions and no commits. 2. checkStoryCompletion: require COMPLETED (not just READY) for all top-level tasks before advancing a story to SHIPPABLE. READY means the checker agent is still pending or the task awaits human review; a story with READY tasks is not ready to ship. 3. handleAcceptTask: call CheckStoryCompletion after a task is accepted so stories with parent tasks (whose subtasks are all done and then the parent is manually accepted) can auto-advance to SHIPPABLE. Co-Authored-By: Claude Sonnet 4.6 --- internal/api/server.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'internal/api') diff --git a/internal/api/server.go b/internal/api/server.go index 604f354..e7756d1 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -697,6 +697,9 @@ func (s *Server) handleAcceptTask(w http.ResponseWriter, r *http.Request) { writeJSON(w, http.StatusInternalServerError, map[string]string{"error": err.Error()}) return } + if t.StoryID != "" { + go s.pool.CheckStoryCompletion(r.Context(), t.StoryID) + } writeJSON(w, http.StatusOK, map[string]string{"message": "task accepted", "task_id": id}) } -- cgit v1.2.3