From 7dc9281f056203bfdfe3e9e0e28674be6d08225f Mon Sep 17 00:00:00 2001 From: ygd58 Date: Thu, 12 Mar 2026 13:25:09 +0100 Subject: [PATCH] fix(vision): surface actual error reason instead of generic message When vision_analyze_tool fails, the except block was returning a generic 'could not be analyzed' message that gave the agent no actionable information about the failure cause. Replace the generic message with the actual exception string so the agent can distinguish between backend errors, missing dependencies, network failures, and unsupported image paths. Also add an 'error' field to the failure response for structured error handling by callers. Fixes #1034 --- tools/vision_tools.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/vision_tools.py b/tools/vision_tools.py index c1b09a22d..264532e9a 100644 --- a/tools/vision_tools.py +++ b/tools/vision_tools.py @@ -354,6 +354,7 @@ async def vision_analyze_tool( # Prepare error response result = { "success": False, + "error": error_msg, "analysis": analysis, }