From f6ca0bb887a5c802d625a551d1a8e34c06903f41 Mon Sep 17 00:00:00 2001 From: Molecule AI App-FE Date: Thu, 23 Apr 2026 18:03:57 +0000 Subject: [PATCH] fix(workspace): replace bare except-pass with self-documenting comments in a2a_executor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Addresses issue #1787 — replaces two bare `except ...: pass` blocks with explanatory comments so the suppression intent is clear to future readers without needing to trace through the original motivation commit. --- workspace/a2a_executor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/workspace/a2a_executor.py b/workspace/a2a_executor.py index 39ca159eb..8702c6ae2 100644 --- a/workspace/a2a_executor.py +++ b/workspace/a2a_executor.py @@ -417,6 +417,8 @@ async def _core_execute(self, context: RequestContext, event_queue: EventQueue) try: msg.metadata = {"tool_trace": tool_trace} except (AttributeError, TypeError): + # Suppress intentionally: new_agent_text_message() may return a + # plain string in test-mock paths where metadata assignment raises. pass await event_queue.enqueue_event(msg) _result = final_text @@ -428,6 +430,7 @@ async def _core_execute(self, context: RequestContext, event_queue: EventQueue) from opentelemetry.trace import StatusCode task_span.set_status(StatusCode.ERROR, str(e)) except Exception: + # Telemetry instrumentation is best-effort; never let it crash the executor. pass # Emit a Message so both streaming and non-streaming clients # receive an error response rather than hanging.