From 3859535fbf4370db90aca074916587dfc6782177 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Sat, 30 May 2026 10:36:24 +0800 Subject: [PATCH] auto-sync: 2026-05-30 10:36:24 (catch-all) --- src/daemon/dispatcher.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/daemon/dispatcher.py b/src/daemon/dispatcher.py index 2f8e675..c0c0b3e 100644 --- a/src/daemon/dispatcher.py +++ b/src/daemon/dispatcher.py @@ -221,7 +221,18 @@ class Dispatcher: except Exception as e: logger.error("Mail %s: on_complete error: %s", _task_id, e) on_complete = _mail_on_complete - # Task 不需要业务回调 + else: + # #02: Task 路径也加 on_complete(幻觉门控) + _task_id = task.id + _task_db = Path(project_config["db_path"]) if project_config and "db_path" in project_config else None + _dispatcher = self + + def _task_on_complete(aid, outcome): + try: + _dispatcher._task_auto_complete(_task_id, _task_db) + except Exception as e: + logger.error("Task %s: on_complete error: %s", _task_id, e) + on_complete = _task_on_complete session_id = await self.spawner.spawn_full_agent( agent_id=agent_id,