agent-zero/helpers
protolabs42 0e5e9851d4 fix: move_dir fails across Docker volume mount points + call_plugin_hook crashes on missing plugin dir
## move_dir (helpers/files.py)

`os.rename` fails with `OSError: [Errno 18] Invalid cross-device link` when
source and destination are on different Docker volume bind mounts (e.g.,
`/a0/tmp` and `/a0/usr` as separate named volumes). The current code catches
the exception with `except Exception: pass`, silently dropping the move.

This breaks plugin installation via the Plugin Hub — the cloned repo in
`/tmp/` never reaches `usr/plugins/` because the rename silently fails.

Fix: fall back to `shutil.move` on `OSError`, which handles cross-mount
moves by copy + delete.

## call_plugin_hook (helpers/plugins.py)

`find_plugin_dir(plugin_name)` can return `None` when called during
`run_install_hook` immediately after installation. Passing `None` to
`files.get_abs_path()` causes `TypeError: join() argument must be str,
bytes, or os.PathLike object, not 'NoneType'`.

This crashes the install hook, which triggers cleanup that deletes the
just-installed plugin directory, making the installation appear to fail
even though the clone and validation succeeded.

Fix: guard the `None` return and short-circuit with `default`.

## Reproduction

Deploy Agent Zero with per-directory volume mounts (as recommended in
docs to avoid volume shadowing):

```yaml
volumes:
  - a0-tmp:/a0/tmp
  - a0-usr:/a0/usr
  - a0-agents:/a0/agents
```

Then install any plugin from the Plugin Hub. Both bugs trigger:
1. `move_dir` silently fails (cross-mount rename)
2. `call_plugin_hook` crashes (plugin dir not found after failed move)
2026-03-19 04:10:58 +02:00
..
api.py refactor: add file system watchdog support for API handlers, extensions, and plugins 2026-03-18 21:07:33 +01:00
attachment_manager.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
backup.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
browser.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
browser_use.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
browser_use_monkeypatch.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
cache.py refactor: add file system watchdog support for API handlers, extensions, and plugins 2026-03-18 21:07:33 +01:00
call_llm.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
cloudflare_tunnel._py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
context.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
crypto.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
defer.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
dirty_json.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
docker.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
document_query.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
dotenv.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
duckduckgo_search.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
email_client.py refactor - plugin names and builtin plugins 2026-03-10 22:20:53 +01:00
errors.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
extension.py refactor: add file system watchdog support for API handlers, extensions, and plugins 2026-03-18 21:07:33 +01:00
extract_tools.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
faiss_monkey_patch.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
fasta2a_client.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
fasta2a_server.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
file_browser.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
file_tree.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
files.py fix: move_dir fails across Docker volume mount points + call_plugin_hook crashes on missing plugin dir 2026-03-19 04:10:58 +02:00
git.py refactor(git): Restructure git helpers with dataclasses and add remote update checking 2026-03-13 15:18:13 +01:00
guids.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
history.py feat: add _model_config plugin with call-time model resolution 2026-03-14 09:41:19 -07:00
images.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
job_loop.py feat: Add email integration plugin with IMAP/Exchange polling and SMTP reply 2026-03-15 10:59:48 +08:00
kokoro_tts.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
kvp.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
localization.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
log.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
login.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
mcp_handler.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
mcp_server.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
message_queue.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
messages.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
migration.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
notification.py Add tool request validation and plugin change notifications 2026-03-10 13:08:48 +01:00
performance.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
perplexity_search.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
persist_chat.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
playwright.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
plugins.py fix: move_dir fails across Docker volume mount points + call_plugin_hook crashes on missing plugin dir 2026-03-19 04:10:58 +02:00
print_catch.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
print_style.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
process.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
projects.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
providers.py Remove redundant provider reload call from plugin change handler 2026-03-12 07:31:45 +01:00
rate_limiter.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
rfc.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
rfc_exchange.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
rfc_files.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
runtime.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
searxng.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
secrets.py feat(secrets): add @extensible decorator to secrets factory functions 2026-03-12 15:30:50 +00:00
security.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
settings.py feat: add _model_config plugin with call-time model resolution 2026-03-14 09:41:19 -07:00
skills.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
skills_cli.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
skills_import.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
state_monitor.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
state_monitor_integration.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
state_snapshot.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
strings.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
subagents.py refactor: improve caching system and optimize extension/plugin path resolution 2026-03-18 12:40:33 +01:00
task_scheduler.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
timed_input.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
tokens.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
tool.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
tunnel_manager.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
update_check.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
vector_db.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
wait.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
watchdog.py refactor: add file system watchdog support for API handlers, extensions, and plugins 2026-03-18 21:07:33 +01:00
websocket.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
websocket_manager.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
websocket_namespace_discovery.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
whisper.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00
ws.py refactor: optimize WebSocket handler lifecycle and fix extension asset path handling 2026-03-17 17:00:40 +01:00
yaml.py BIG PYTHON REFACTOR 2026-03-05 17:28:11 +01:00