diff --git a/src/daemon/ticker.py b/src/daemon/ticker.py index 8fae7ae..47585c0 100644 --- a/src/daemon/ticker.py +++ b/src/daemon/ticker.py @@ -488,9 +488,9 @@ class Ticker: return [] # 全局并发检查(司马懿建议 1) - if self.counter.global_active >= self.counter._max_global - 1: + if self.counter.is_near_limit(): logger.info("Skipping broadcast: global concurrent near limit (%d/%d)", - self.counter.global_active, self.counter._max_global) + self.counter.global_active, self.counter.max_global) return [] # 过滤掉已广播太多次的任务(retry_count >= 3 → 不广播,等庞统) @@ -524,17 +524,8 @@ class Ticker: # 获取空闲 Agent idle_agents = self._get_idle_agents() if not idle_agents: - # 无空闲 Agent → 递增 retry_count(下次广播或升级) - conn = get_connection(db_path) - try: - for t in broadcastable: - conn.execute( - "UPDATE tasks SET retry_count = COALESCE(retry_count, 0) + 1 WHERE id=?", - (t.id,), - ) - conn.commit() - finally: - conn.close() + # 无空闲 Agent → 系统容量问题,不递增 retry_count + logger.warning("No idle agents for broadcast, skipping (capacity issue)") return [] task_ids = [t.id for t in broadcastable]