Skip to content

Commit 8fb93f1

Browse files
committed
fix(agent): agent as remoting service should not have memory
1 parent 0209ff1 commit 8fb93f1

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

AgentCrew/modules/a2a/task_manager.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def __init__(self, agent_name: str, agent_manager: AgentManager):
8585
if self.agent is None or not isinstance(self.agent, LocalAgent):
8686
raise ValueError(f"Agent {agent_name} not found or is not a LocalAgent")
8787

88-
self.memory_service = self.agent.services["memory"]
88+
self.memory_service = self.agent.services.get("memory", None)
8989

9090
def _is_terminal_state(self, state: TaskState) -> bool:
9191
"""Check if a state is terminal."""
@@ -573,9 +573,10 @@ def process_result(_tool_uses, _input_tokens, _output_tokens):
573573
.get("content", [{}])[0]
574574
.get("text", "")
575575
)
576-
self.memory_service.store_conversation(
577-
user_message, current_response, self.agent_name
578-
)
576+
if self.memory_service:
577+
self.memory_service.store_conversation(
578+
user_message, current_response, self.agent_name
579+
)
579580

580581
# Create artifact from final response
581582
artifact = convert_agent_response_to_a2a_artifact(

AgentCrew/modules/agents/local_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ def _enhance_agent_context_messages(self, final_messages: List[Dict[str, Any]]):
634634
- Skip agent evaluation if user request is when...,[action]... related to adaptive behaviors call `adapt` tool instead.""",
635635
},
636636
)
637-
if self.services.get("memory"):
637+
if not self.is_remoting_mode and self.services.get("memory"):
638638
memory_headers = self.services["memory"].list_memory_headers(
639639
agent_name=self.name
640640
)

0 commit comments

Comments
 (0)