diff --git a/src/daemon/ticker.py b/src/daemon/ticker.py index 34fce13..84f3a0f 100644 --- a/src/daemon/ticker.py +++ b/src/daemon/ticker.py @@ -409,11 +409,18 @@ class Ticker: now = datetime.utcnow().isoformat() # 重置到 pending 时清空 assignee(避免残留导致重复路由到同一 Agent) + # 但 Mail 的 assignee 是收件人,永不清空 if new_status == "pending": - conn.execute( - "UPDATE tasks SET status=?, assignee=NULL, resumed_from=NULL, updated_at=? WHERE id=?", - (new_status, now, task_id), - ) + if self._current_project_id == "_mail": + conn.execute( + "UPDATE tasks SET status=?, updated_at=? WHERE id=?", + (new_status, now, task_id), + ) + else: + conn.execute( + "UPDATE tasks SET status=?, assignee=NULL, resumed_from=NULL, updated_at=? WHERE id=?", + (new_status, now, task_id), + ) elif new_status == "paused": # 记录暂停前状态,恢复时回到原状态 conn.execute(