auto-sync: 2026-05-23 00:47:15
This commit is contained in:
@@ -149,6 +149,8 @@ class AgentSpawner:
|
||||
|
||||
# session 注册表 {session_id: {...}}
|
||||
self._sessions: Dict[str, Dict[str, Any]] = {}
|
||||
# B2 compact 等待计数器 {task_id: count}
|
||||
self._compact_waits: Dict[str, int] = {}
|
||||
|
||||
@property
|
||||
def active_sessions(self) -> Dict[str, Dict[str, Any]]:
|
||||
@@ -511,8 +513,8 @@ curl -X POST http://{api_host}:{api_port}/api/projects/{project_id}/tasks/{task_
|
||||
agent_id, session_id, monitor_timeout_count, self.max_monitor_timeouts)
|
||||
# 不递增 monitor_timeout_count,但最多额外等 max_monitor_timeouts 次
|
||||
# 用独立计数器防止无限等待
|
||||
compact_wait_count = getattr(self, f"_compact_waits_{task_id}", 0) + 1
|
||||
setattr(self, f"_compact_waits_{task_id}", compact_wait_count)
|
||||
compact_wait_count = self._compact_waits.get(task_id, 0) + 1
|
||||
self._compact_waits[task_id] = compact_wait_count
|
||||
if compact_wait_count >= self.max_monitor_timeouts:
|
||||
logger.error("Agent %s max compact waits reached (session=%s, count=%d)",
|
||||
agent_id, session_id, compact_wait_count)
|
||||
|
||||
Reference in New Issue
Block a user