fix(builtin_tools): remove duplicate unreachable error-handling block
Some checks failed
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 9s
sop-tier-check / tier-check (pull_request) Failing after 8s
audit-force-merge / audit (pull_request) Has been skipped

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 <noreply@anthropic.com>
This commit is contained in:
Molecule AI · infra-runtime-be 2026-05-11 05:29:08 +00:00
parent 7986648ebd
commit 7123ad4280

View File

@ -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}"