From 020fcfcb258e470618153747641ae11c3082e2db Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 18 Feb 2026 13:59:49 +0100 Subject: [PATCH] Fix loading non-tool XML files from watched tool directories The quick_load callback in __watch_directory is used both during the initial directory scan (where _looks_like_a_tool is checked beforehand) and as a callback for the ToolWatcher (where no such check occurs). When the watcher detects a file system event for any .xml file in a watched directory, it calls quick_load directly without verifying the file is actually a tool. This causes files like macros.xml to be loaded as tools and fail with "Missing tool 'id'" errors. Add a _looks_like_a_tool guard inside quick_load itself so the check is always applied regardless of the caller. --- lib/galaxy/tool_util/toolbox/base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/galaxy/tool_util/toolbox/base.py b/lib/galaxy/tool_util/toolbox/base.py index f081f028e20..f69491ed463 100644 --- a/lib/galaxy/tool_util/toolbox/base.py +++ b/lib/galaxy/tool_util/toolbox/base.py @@ -1146,6 +1146,8 @@ class AbstractToolBox(ManagesIntegratedToolPanelMixin): force_watch: bool = False, ) -> None: def quick_load(tool_file: "StrPath", async_load: bool = True) -> Union[str, None]: + if not self._looks_like_a_tool(str(tool_file)): + return None try: tool = self.load_tool(tool_file) self.__add_tool(tool, load_panel_dict, elems)