From 7123ad4280cbf3190ac35527aa435ffc867bfdbf Mon Sep 17 00:00:00 2001 From: Molecule AI Infra-Runtime-BE Date: Mon, 11 May 2026 05:29:08 +0000 Subject: [PATCH] fix(builtin_tools): remove duplicate unreachable error-handling block Issue #350: staging commit bea89ce4 inserted a correct error-handling block for string-form errors but left the pre-existing block after the return, creating unreachable dead code. Fix: keep only the first block (which includes the explanatory comment added in PR #367). Main already has the correct single-block version. This change aligns staging's builtin_tools/a2a_tools.py with main. Co-Authored-By: Claude Opus 4.7 --- workspace/builtin_tools/a2a_tools.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/workspace/builtin_tools/a2a_tools.py b/workspace/builtin_tools/a2a_tools.py index 48b813a1..d568ee40 100644 --- a/workspace/builtin_tools/a2a_tools.py +++ b/workspace/builtin_tools/a2a_tools.py @@ -87,14 +87,6 @@ async def delegate_task(workspace_id: str, task: str) -> str: else: msg = str(err) return f"Error: {msg}" - msg = "" - if isinstance(err, dict): - msg = err.get("message", "") - elif isinstance(err, str): - msg = err - else: - msg = str(err) - return f"Error: {msg}" return str(data) except Exception as e: return f"Error sending A2A message: {e}"