fix: handle string results in tool renderers

Previously, tool renderers assumed result was always a dict and would
crash with AttributeError when result was a string (e.g., error messages).
Now all renderers properly check for string results and display them.
This commit is contained in:
0xallam
2026-01-09 16:32:40 -08:00
committed by Ahmed Allam
parent 226678f3f2
commit 7b7ea59a37
6 changed files with 71 additions and 17 deletions
@@ -102,7 +102,10 @@ class ListNotesRenderer(BaseToolRenderer):
text.append("📝 ")
text.append("Notes", style="bold #fbbf24")
if result and isinstance(result, dict) and result.get("success"):
if isinstance(result, str) and result.strip():
text.append("\n ")
text.append(result.strip(), style="dim")
elif result and isinstance(result, dict) and result.get("success"):
count = result.get("total_count", 0)
notes = result.get("notes", []) or []