diff --git a/src/daemon/dispatcher.py b/src/daemon/dispatcher.py index 3e344c3..6a96fb9 100644 --- a/src/daemon/dispatcher.py +++ b/src/daemon/dispatcher.py @@ -145,9 +145,20 @@ class Dispatcher: try: if self.counter: await self.counter.acquire(agent_id) - session_id = await self.spawner.spawn_full_agent( - agent_id=agent_id, - message=self._build_message(task, action_type), + # 优先使用 spawner 的 prompt 模板 + if hasattr(self.spawner, 'build_spawn_message') and project_config: + message = self.spawner.build_spawn_message( + task_id=task.id, + title=task.title, + description=task.description or "", + task_type=task.task_type or "", + priority=task.priority, + must_haves=task.must_haves or "", + project_id=project_config.get("project_id", ""), + agent_id=agent_id, + ) + else: + message = self._build_message(task, action_type) new_session=decision.get("new_session", False), task_id=task.id, )