diff --git a/src/daemon/dispatcher.py b/src/daemon/dispatcher.py index 8d73093..3eec186 100644 --- a/src/daemon/dispatcher.py +++ b/src/daemon/dispatcher.py @@ -187,6 +187,29 @@ class Dispatcher: if is_mail: db_path = Path(project_config["db_path"]) if project_config and "db_path" in project_config else None + # 方案C:inform 类 Mail 不 spawn Agent,直接标 done + if is_mail: + _perf = "request" + try: + _meta = json.loads(task.must_haves) if task.must_haves else {} + _perf = _meta.get("performative", _meta.get("type", "request")) + except Exception: + pass + if _perf == "inform": + # 直接标 working → done,不 spawn + _db_path = Path(project_config["db_path"]) if project_config and "db_path" in project_config else None + if _db_path: + self._mail_auto_working(task.id, _db_path) + self._mail_auto_complete(task.id, agent_id, _db_path, task.must_haves or "") + self._record_routing(task, decision, "dispatched", "inform_skip_spawn", _routing_db) + return { + "level": "mail", + "agent_id": agent_id, + "session_id": None, + "status": "dispatched", + "reason": "inform_skip_spawn", + } + # on_checks_passed: 所有检查通过后才标 working,检查失败不标 on_checks_passed = None _mail_marked_working = False