From 6d7e7c2944e2064d51a1f9d1e3493fc4643ebcd0 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 21 Mar 2026 19:59:02 +0000 Subject: [PATCH] Optimize team filtering loop performance Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com> --- cli/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/main.py b/cli/main.py index fdf543cb..ebd82f83 100644 --- a/cli/main.py +++ b/cli/main.py @@ -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