diff --git a/src/daemon/dispatcher.py b/src/daemon/dispatcher.py index fcdfed8..8606850 100644 --- a/src/daemon/dispatcher.py +++ b/src/daemon/dispatcher.py @@ -122,6 +122,8 @@ class Dispatcher: decision = self.decide(task, action_type) level = decision["level"] + # 从 project_config 获取项目级 DB 路径(路由审计日志写入项目 DB) + _routing_db = Path(project_config["db_path"]) if project_config and "db_path" in project_config else None agent_id = decision["agent_id"] # 检查并发限制 @@ -245,7 +247,7 @@ class Dispatcher: if not effective_db: return try: - conn = sqlite3.connect(str(self.db_path)) + conn = sqlite3.connect(str(effective_db)) conn.row_factory = sqlite3.Row try: conn.execute("BEGIN IMMEDIATE")