From c0ee23e996d45c165fa605e14e1d6f9e8b231434 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Sun, 17 May 2026 21:42:55 +0800 Subject: [PATCH] auto-sync: 2026-05-17 21:42:55 --- src/daemon/dispatcher.py | 6 ++++-- src/daemon/ticker.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/daemon/dispatcher.py b/src/daemon/dispatcher.py index cdf91d8..fcdfed8 100644 --- a/src/daemon/dispatcher.py +++ b/src/daemon/dispatcher.py @@ -238,9 +238,11 @@ class Dispatcher: return "\n".join(parts) def _record_routing(self, task: Task, decision: Dict[str, Any], - outcome: str, detail: Optional[str]) -> None: + outcome: str, detail: Optional[str], + override_db_path: Optional[Path] = None) -> None: """写路由审计日志到 routing_decisions 表""" - if not self.db_path: + effective_db = override_db_path or self.db_path + if not effective_db: return try: conn = sqlite3.connect(str(self.db_path)) diff --git a/src/daemon/ticker.py b/src/daemon/ticker.py index d91b259..bbeb3d0 100644 --- a/src/daemon/ticker.py +++ b/src/daemon/ticker.py @@ -383,7 +383,7 @@ class Ticker: result = await self.dispatcher.dispatch( task, action_type="review", - project_config={"project_id": project_id}, + project_config={"project_id": project_id, "db_path": db_path}, ) if result["status"] == "dispatched": dispatched.append(task.id)