fix(gui): Restore 'Load Log' button and fix docking crash

fix(mcp): Improve path resolution and error messages
This commit is contained in:
2026-02-23 23:00:17 -05:00
parent f5ef2d850f
commit dbf2962c54
2 changed files with 10 additions and 8 deletions

View File

@@ -718,8 +718,9 @@ class App:
exp, self.show_windows["Discussion Hub"] = imgui.begin("Discussion Hub", self.show_windows["Discussion Hub"]) exp, self.show_windows["Discussion Hub"] = imgui.begin("Discussion Hub", self.show_windows["Discussion Hub"])
if exp: if exp:
# Top part for the history # 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() self._render_discussion_panel()
imgui.end_child()
# Bottom part with tabs for message and response # Bottom part with tabs for message and response
if imgui.begin_tab_bar("MessageResponseTabs"): if imgui.begin_tab_bar("MessageResponseTabs"):
@@ -1175,6 +1176,9 @@ class App:
save_config(self.config) save_config(self.config)
self.ai_status = "discussion saved" self.ai_status = "discussion saved"
imgui.same_line() imgui.same_line()
if imgui.button("Load Log"):
self.cb_load_prior_log()
imgui.same_line()
if imgui.button("Load Log"): if imgui.button("Load Log"):
self.cb_load_prior_log() self.cb_load_prior_log()

View File

@@ -112,16 +112,14 @@ def _resolve_and_check(raw_path: str) -> tuple[Path | None, str]:
p = Path(raw_path) p = Path(raw_path)
if not p.is_absolute() and _primary_base_dir: if not p.is_absolute() and _primary_base_dir:
p = _primary_base_dir / p p = _primary_base_dir / p
try: p = p.resolve()
p = p.resolve(strict=True)
except (OSError, ValueError):
p = p.resolve()
except Exception as e: except Exception as e:
return None, f"ERROR: invalid path '{raw_path}': {e}" return None, f"ERROR: invalid path '{raw_path}': {e}"
if not _is_allowed(p): if not _is_allowed(p):
allowed_bases = "\\n".join([f" - {d}" for d in _base_dirs])
return None, ( return None, (
f"ACCESS DENIED: '{raw_path}' is not within the allowed paths. " f"ACCESS DENIED: '{raw_path}' resolves to '{p}', which is not within the allowed paths.\\n"
f"Use list_directory or search_files on an allowed base directory first." f"Allowed base directories are:\\n{allowed_bases}"
) )
return p, "" return p, ""