From 2d436c0be1f47f7c42e2eced72db15ccf89e3eb6 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Thu, 21 May 2026 20:03:40 +0800 Subject: [PATCH] auto-sync: 2026-05-21 20:03:40 --- src/daemon/ticker.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/daemon/ticker.py b/src/daemon/ticker.py index a72a365..27c6f8f 100644 --- a/src/daemon/ticker.py +++ b/src/daemon/ticker.py @@ -395,10 +395,17 @@ class Ticker: return False now = datetime.utcnow().isoformat() - conn.execute( - "UPDATE tasks SET status=?, updated_at=? WHERE id=?", - (new_status, now, task_id), - ) + # 重置到 pending 时清空 assignee(避免残留导致重复路由到同一 Agent) + if new_status == "pending": + conn.execute( + "UPDATE tasks SET status=?, assignee=NULL, updated_at=? WHERE id=?", + (new_status, now, task_id), + ) + else: + conn.execute( + "UPDATE tasks SET status=?, updated_at=? WHERE id=?", + (new_status, now, task_id), + ) event_type = f"task_{new_status}" if event_type not in EVENT_TYPES: event_type = "daemon_tick"