Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix(core): remove send_message tool requirement from A2A messages (#9383)

Cameron89a7a12b38d0
diff --git a/letta/functions/function_sets/multi_agent.py b/letta/functions/function_sets/multi_agent.py
index 1ffec99eb..b1690ed99 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 0e11e4b85..3e041b92e 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