Fix MangenticAgentExecutor producing repr str for tool call content (#2566)

This commit is contained in:
Evan Mattson
2025-12-02 17:40:11 +09:00
committed by GitHub
Unverified
parent cb343dd707
commit c2d285e614
2 changed files with 2 additions and 2 deletions
@@ -1727,7 +1727,7 @@ class MagenticAgentExecutor(Executor):
last: ChatMessage = messages[-1]
author = last.author_name or self._agent_id
role: Role = last.role if last.role else Role.ASSISTANT
text = last.text or str(last)
text = last.text or ""
msg = ChatMessage(role=role, text=text, author_name=author)
await self._emit_agent_message_event(ctx, msg)
return msg
@@ -1274,7 +1274,7 @@ class MessageMapper:
"trace_type": "magentic_orchestrator",
"orchestrator_id": orchestrator_id,
"kind": kind,
"text": text or str(message),
"text": text or "",
"timestamp": datetime.now().isoformat(),
},
span_id=f"magentic_orch_{uuid4().hex[:8]}",