From 89a7a12b38d085a4ff4ce3c19dfbbe0937f933fe Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 9 Feb 2026 10:28:00 -0800 Subject: [PATCH] fix(core): remove send_message tool requirement from A2A messages (#9383) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The A2A messaging tools were instructing receiving agents to use the send_message tool to reply, but that tool is often not attached to agents anymore. This caused agents confusion when they couldn't find the required tool. For synchronous functions (send_message_to_agent_and_wait_for_reply, send_message_to_agents_matching_tags, send_message_to_all_agents_in_group), the system already captures AssistantMessage automatically, so agents just need to respond normally. For the async/fire-and-forget function (send_message_to_agent_async), updated to indicate it's a one-way notification and hint that messaging tools exist without requiring a specific one. 🤖 Generated with [Letta Code](https://letta.com) Co-authored-by: Letta --- letta/functions/function_sets/multi_agent.py | 14 ++++---------- letta/functions/helpers.py | 4 +--- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/letta/functions/function_sets/multi_agent.py b/letta/functions/function_sets/multi_agent.py index 1ffec99e..b1690ed9 100644 --- a/letta/functions/function_sets/multi_agent.py +++ b/letta/functions/function_sets/multi_agent.py @@ -24,9 +24,7 @@ def send_message_to_agent_and_wait_for_reply(self: "Agent", message: str, other_ str: The response from the target agent. """ augmented_message = ( - f"[Incoming message from agent with ID '{self.agent_state.id}' - to reply to this message, " - f"make sure to use the 'send_message' at the end, and the system will notify the sender of your response] " - f"{message}" + f"[Incoming message from agent with ID '{self.agent_state.id}' - your response will be delivered to the sender] {message}" ) messages = [MessageCreate(role=MessageRole.system, content=augmented_message, name=self.agent_state.name)] @@ -53,11 +51,7 @@ def send_message_to_agents_matching_tags(self: "Agent", message: str, match_all: in the returned list. """ server = get_letta_server() - augmented_message = ( - f"[Incoming message from external Letta agent - to reply to this message, " - f"make sure to use the 'send_message' at the end, and the system will notify the sender of your response] " - f"{message}" - ) + augmented_message = f"[Incoming message from external Letta agent - your response will be delivered to the sender] {message}" # Find matching agents matching_agents = server.agent_manager.list_agents_matching_tags(actor=self.user, match_all=match_all, match_some=match_some) @@ -100,8 +94,8 @@ def send_message_to_agent_async(self: "Agent", message: str, other_agent_id: str raise RuntimeError("This tool is not allowed to be run on Letta Cloud.") message = ( - f"[Incoming message from agent with ID '{self.agent_state.id}' - to reply to this message, " - f"make sure to use the 'send_message_to_agent_async' tool, or the agent will not receive your message] " + f"[Incoming message from agent with ID '{self.agent_state.id}' - " + f"this is a one-way notification; if you need to respond, use an agent-to-agent messaging tool if available] " f"{message}" ) messages = [MessageCreate(role=MessageRole.system, content=message, name=self.agent_state.name)] diff --git a/letta/functions/helpers.py b/letta/functions/helpers.py index 0e11e4b8..3e041b92 100644 --- a/letta/functions/helpers.py +++ b/letta/functions/helpers.py @@ -464,9 +464,7 @@ async def _send_message_to_all_agents_in_group_async(sender_agent: "Agent", mess server = get_letta_server() augmented_message = ( - f"[Incoming message from agent with ID '{sender_agent.agent_state.id}' - to reply to this message, " - f"make sure to use the 'send_message' at the end, and the system will notify the sender of your response] " - f"{message}" + f"[Incoming message from agent with ID '{sender_agent.agent_state.id}' - your response will be delivered to the sender] {message}" ) worker_agents_ids = sender_agent.agent_state.multi_agent_group.agent_ids