From 0b753d8918ca0447d2ac1f6a5344db1c62d0e9e3 Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Fri, 10 Jul 2026 19:02:49 +0530 Subject: [PATCH] fix(display): harden fallback label formatting --- agent/display.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/agent/display.py b/agent/display.py index 39879e2631e..66872c35d66 100644 --- a/agent/display.py +++ b/agent/display.py @@ -1451,8 +1451,9 @@ def get_cute_tool_message( return _get_cute_tool_message(tool_name, args, duration, result=result) except Exception as exc: # noqa: BLE001 — display must never abort a turn logger.debug("Tool completion label failed for %s: %s", tool_name, exc) - safe_name = str(tool_name or "tool")[:9] - return f"┊ ⚡ {safe_name:9} completed {duration:.1f}s" + safe_name = tool_name[:9] if isinstance(tool_name, str) and tool_name else "tool" + safe_duration = f"{duration:.1f}s" if isinstance(duration, (int, float)) else "done" + return f"┊ ⚡ {safe_name:9} completed {safe_duration}" # =========================================================================