From dbf2962c54c7b92e5985337690f2ef83ac46afb9 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Mon, 23 Feb 2026 23:00:17 -0500 Subject: [PATCH] fix(gui): Restore 'Load Log' button and fix docking crash fix(mcp): Improve path resolution and error messages --- gui_2.py | 8 ++++++-- mcp_client.py | 10 ++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/gui_2.py b/gui_2.py index 5951638..dc2e117 100644 --- a/gui_2.py +++ b/gui_2.py @@ -718,8 +718,9 @@ class App: exp, self.show_windows["Discussion Hub"] = imgui.begin("Discussion Hub", self.show_windows["Discussion Hub"]) if exp: # Top part for the history - with imgui.begin_child("HistoryChild", size=(0, -200)): + if imgui.begin_child("HistoryChild", size=(0, -200)): self._render_discussion_panel() + imgui.end_child() # Bottom part with tabs for message and response if imgui.begin_tab_bar("MessageResponseTabs"): @@ -1175,6 +1176,9 @@ class App: save_config(self.config) self.ai_status = "discussion saved" imgui.same_line() + if imgui.button("Load Log"): + self.cb_load_prior_log() + imgui.same_line() if imgui.button("Load Log"): self.cb_load_prior_log() @@ -1604,7 +1608,7 @@ class App: imgui.text("Project System Prompt") ch, self.ui_project_system_prompt = imgui.input_text_multiline("##psp", self.ui_project_system_prompt, imgui.ImVec2(-1, 100)) - def _render_theme_panel(self): + def _render_theme_panel(self): exp, self.show_windows["Theme"] = imgui.begin("Theme", self.show_windows["Theme"]) if exp: imgui.text("Palette") diff --git a/mcp_client.py b/mcp_client.py index 5fdb5f1..f7c72e0 100644 --- a/mcp_client.py +++ b/mcp_client.py @@ -112,16 +112,14 @@ def _resolve_and_check(raw_path: str) -> tuple[Path | None, str]: p = Path(raw_path) if not p.is_absolute() and _primary_base_dir: p = _primary_base_dir / p - try: - p = p.resolve(strict=True) - except (OSError, ValueError): - p = p.resolve() + p = p.resolve() except Exception as e: return None, f"ERROR: invalid path '{raw_path}': {e}" if not _is_allowed(p): + allowed_bases = "\\n".join([f" - {d}" for d in _base_dirs]) return None, ( - f"ACCESS DENIED: '{raw_path}' is not within the allowed paths. " - f"Use list_directory or search_files on an allowed base directory first." + f"ACCESS DENIED: '{raw_path}' resolves to '{p}', which is not within the allowed paths.\\n" + f"Allowed base directories are:\\n{allowed_bases}" ) return p, ""