Optimize team filtering loop performance

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
This commit is contained in:
google-labs-jules[bot] 2026-03-21 19:59:02 +00:00
parent a7b8c996f2
commit 6d7e7c2944
1 changed files with 2 additions and 1 deletions

View File

@ -304,8 +304,9 @@ def update_display(layout, spinner_text=None, stats_handler=None, start_time=Non
# Filter teams to only include agents that are in agent_status
teams = {}
active_agent_status_keys = set(message_buffer.agent_status.keys())
for team, agents in all_teams.items():
active_agents = [a for a in agents if a in message_buffer.agent_status]
active_agents = [a for a in agents if a in active_agent_status_keys]
if active_agents:
teams[team] = active_agents