auto-sync: 2026-05-23 00:37:46

This commit is contained in:
cfdaily
2026-05-23 00:37:46 +08:00
parent b6fb0c93a0
commit 5c65230352
+8 -7
View File
@@ -128,16 +128,17 @@ class Blackboard:
elif new_status == "paused":
updates["completed_at"] = now # paused 也记录时间用于恢复
updates["resumed_from"] = old_status # 记录暂停前状态
elif new_status == "pending" and old_status == "failed":
updates["retry_count"] = (
conn.execute("SELECT retry_count FROM tasks WHERE id=?",
(task_id,)).fetchone()["retry_count"] + 1
)
# BUG-1: failed→pending 必须清空 assignee/claimed_at/current_agent
# 否则 dispatcher 会走确定性路由而非广播
elif new_status == "pending":
# 所有 →pending 转换都清空 assignee(与 ticker._transition_status L414 对齐)
updates["assignee"] = None
updates["claimed_at"] = None
updates["current_agent"] = None
if old_status == "failed":
# 仅 failed→pending 递增 retry_count
updates["retry_count"] = (
conn.execute("SELECT retry_count FROM tasks WHERE id=?",
(task_id,)).fetchone()["retry_count"] + 1
)
set_clause = ", ".join(f"{k}=?" for k in updates)
conn.execute(