From 3076b1fff35725215fe24fff9dd2124d5e04ded4 Mon Sep 17 00:00:00 2001 From: vanja-emichi Date: Fri, 21 Aug 2026 03:27:35 +0200 Subject: [PATCH] Surface tool load errors in get_tool fallback get_tool silently swallows exceptions raised while loading a tool module and falls back to the Unknown tool. When a plugin tool fails to import (e.g. a stale module cache or a missing symbol), the only visible symptom is the generic 'tool not found' message, which sends users debugging the tool name instead of the actual import error. Log the failing path and error to the console before continuing to the next candidate, so the real cause is visible at dispatch time. No behavioral change otherwise. --- agent.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/agent.py b/agent.py index 62beb8bc14..c38172f60a 100644 --- a/agent.py +++ b/agent.py @@ -1572,7 +1572,10 @@ def get_tool( try: classes = extract_tools.load_classes_from_file(path, Tool) # type: ignore[arg-type] break - except Exception: + except Exception as error: + PrintStyle(font_color="red", padding=True).print( + f"Failed to load tool '{name}' from {path}: {error}" + ) continue tool_class = classes[0] if classes else Unknown