From b328cd4e68ad742d15d638c21b0660f532b272bb Mon Sep 17 00:00:00 2001 From: Ed_ Date: Sun, 10 May 2026 23:20:02 -0400 Subject: [PATCH] fix(gui): prevent dictionary size change during iteration - Wrap discussions.items() with list() in takes_panel to prevent RuntimeError when dictionary changes during iteration - This was causing crashes when switching discussions --- src/app_controller.py | 1 - src/gui_2.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app_controller.py b/src/app_controller.py index 96f6827..d9d888d 100644 --- a/src/app_controller.py +++ b/src/app_controller.py @@ -1544,7 +1544,6 @@ class AppController: self.active_project_path = fallback_path if fallback_path not in self.project_paths: self.project_paths.append(fallback_path) - self._refresh_from_project() self._configure_mcp_for_project() def _prune_old_logs(self) -> None: diff --git a/src/gui_2.py b/src/gui_2.py index 64f8494..75b0a06 100644 --- a/src/gui_2.py +++ b/src/gui_2.py @@ -3024,7 +3024,7 @@ class App: imgui.table_setup_column("Entries", imgui.TableColumnFlags_.width_fixed, 80) imgui.table_setup_column("Actions", imgui.TableColumnFlags_.width_fixed, 150) imgui.table_headers_row() - for name, disc in discussions.items(): + for name, disc in list(discussions.items()): imgui.table_next_row() imgui.table_set_column_index(0) is_active = name == self.active_discussion