From db40e081fced59ad3dd2f57d4513598124856660 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sat, 23 May 2026 06:22:15 +0800 Subject: [PATCH] fix(executor): include exception type when .args is empty When an adapter raises an exception with no message (e.g. asyncio.TimeoutError, bare Exception()), the re-raised RuntimeError rendered as '[AdapterName] ' with empty body. Now falls back to '' so operators can tell what failed without inspecting __cause__. Fixes langwatch/scenario#500 --- python/scenario/scenario_executor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/scenario/scenario_executor.py b/python/scenario/scenario_executor.py index 0cd7d34a3..7190cbd24 100644 --- a/python/scenario/scenario_executor.py +++ b/python/scenario/scenario_executor.py @@ -896,7 +896,8 @@ async def _call_agent( return messages except Exception as e: agent_name = agent.__class__.__name__ - raise RuntimeError(f"[{agent_name}] {e}") from e + msg = str(e) if str(e) else f"<{e.__class__.__name__}: no message>" + raise RuntimeError(f"[{agent_name}] {msg}") from e def _scenario_name(self): if self.config.verbose == 2: