Agent Zero AI framework
fix: move_dir fails across Docker volume mount points + call_plugin_hook crashes on missing plugin dir
protolabs420e5e9851d4b1
diff --git a/helpers/files.py b/helpers/files.pyindex 62187f9c2..f07ee1c91 100644--- a/helpers/files.py+++ b/helpers/files.py@@ -486,8 +486,10 @@ def move_dir(old_path: str, new_path: str):try:os.rename(abs_old, abs_new)- except Exception:- pass # suppress all errors, keep behavior consistent+ except OSError:+ # os.rename fails across Docker volume mount points+ import shutil+ shutil.move(abs_old, abs_new)# move dir safely, remove with number if neededdiff --git a/helpers/plugins.py b/helpers/plugins.pyindex 03e288112..999805305 100644--- a/helpers/plugins.py+++ b/helpers/plugins.py@@ -798,7 +798,10 @@ def call_plugin_hook(# use cached hooks if enabledif not cache.has(HOOKS_CACHE_AREA, plugin_name):- hooks_script = files.get_abs_path(find_plugin_dir(plugin_name), HOOKS_SCRIPT)+ plugin_dir = find_plugin_dir(plugin_name)+ if not plugin_dir:+ return default # plugin directory not found, skip hooks+ hooks_script = files.get_abs_path(plugin_dir, HOOKS_SCRIPT)hooks = (extract_tools.import_module(hooks_script)if files.exists(hooks_script)