From c77bb517860c09134d9c2d7b98f15af028f02431 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Thu, 28 May 2026 13:07:27 +0800 Subject: [PATCH] auto-sync: 2026-05-28 13:07:27 --- src/daemon/dispatcher.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/daemon/dispatcher.py b/src/daemon/dispatcher.py index cc35ebb..71c98bc 100644 --- a/src/daemon/dispatcher.py +++ b/src/daemon/dispatcher.py @@ -236,6 +236,9 @@ class Dispatcher: } except AgentBusyError: # v2.7.2: agent 被 counter 占用或冷却中 + # v2.7.3: Mail spawn 失败时回退 working → pending + if is_mail and db_path: + self._mail_revert_to_pending(task.id, db_path) self._record_routing(task, decision, "skipped", "Agent busy", _routing_db) return { "level": level.value, @@ -245,6 +248,9 @@ class Dispatcher: "reason": "Agent busy (concurrent limit or cooling down)", } except Exception as e: + # v2.7.3: Mail spawn 异常时也回退 working → pending + if is_mail and db_path: + self._mail_revert_to_pending(task.id, db_path) self._record_routing(task, decision, "error", str(e), _routing_db) return { "level": level.value,