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
This commit is contained in:
ygd58
2026-03-12 13:25:09 +01:00
committed by teknium1
parent 60710bc8f8
commit 7dc9281f05

View File

@@ -354,6 +354,7 @@ async def vision_analyze_tool(
# Prepare error response
result = {
"success": False,
"error": error_msg,
"analysis": analysis,
}