From 50d0cdb867ce23cec91e00e93a998163aa3c8ea4 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Thu, 21 May 2026 14:13:14 +0800 Subject: [PATCH] auto-sync: 2026-05-21 14:13:14 --- src/daemon/ticker.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/daemon/ticker.py b/src/daemon/ticker.py index 47585c0..a72a365 100644 --- a/src/daemon/ticker.py +++ b/src/daemon/ticker.py @@ -590,15 +590,13 @@ class Ticker: return getattr(self.dispatcher, 'counter', None) if self.dispatcher else None def _get_idle_agents(self) -> List[str]: - """获取当前空闲的 Agent 列表""" + """获取当前空闲的 Agent 列表(从 config agents 取,而非 counter._per_agent)""" if not self.counter: return [] - idle = [] - for agent_id in self.counter._per_agent: - active = self.counter.active_agents.get(agent_id, 0) - if active == 0: - idle.append(agent_id) - return idle + # agent_profiles 在 Router 初始化时从 config 填充,是完整 Agent 列表 + all_agents = list(self.dispatcher.router.agent_profiles.keys()) if self.dispatcher else [] + active = self.counter.active_agents + return [aid for aid in all_agents if active.get(aid, 0) == 0] async def _dispatch_reviews(self, db_path: Path, project_id: str) -> List[str]: