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: revert the cause of workforce reset runtime error bug (#3467)

Ahmed Awelkair A2d8c50f49c38
diff --git a/camel/societies/workforce/workforce.py b/camel/societies/workforce/workforce.py
index 4cbe80157..aa3949f39 100644
--- a/camel/societies/workforce/workforce.py
+++ b/camel/societies/workforce/workforce.py
@@ -2188,7 +2188,11 @@ class Workforce(BaseNode):
)
return [task]
- self.reset()
+ if reset and self._state != WorkforceState.RUNNING:
+ self.reset()
+ logger.info("Workforce reset before handling task.")
+
+ # Focus on the new task
self._task = task
task.state = TaskState.FAILED