Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

fix: agent_pool_race_condition (#3740)

Puzhen Zhangeaeedbe5f20c
diff --git a/camel/societies/workforce/single_agent_worker.py b/camel/societies/workforce/single_agent_worker.py
index 6934e269a..3026e832d 100644
--- a/camel/societies/workforce/single_agent_worker.py
+++ b/camel/societies/workforce/single_agent_worker.py
@@ -114,6 +114,7 @@ class AgentPool:
agent = self._available_agents.popleft()
self._in_use_agents.add(id(agent))
self._pool_hits += 1
+ agent.reset() # Ensure clean memory state
return agent
# Check if we can create a new agent