🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org
Python agentai-societiesartificial-intelligencecommunicative-aicooperative-aideep-learninglarge-language-modelsmulti-agent-systemsnatural-language-processing
fix: errors due to revert (#2634)
Wendong-Fan8f1a9932d706
diff --git a/camel/societies/workforce/workforce.py b/camel/societies/workforce/workforce.pyindex cab272dac..49a75e877 100644--- a/camel/societies/workforce/workforce.py+++ b/camel/societies/workforce/workforce.py@@ -678,7 +678,6 @@ class Workforce(BaseNode):await self._post_ready_tasks()-async def _graceful_shutdown(self, failed_task: Task) -> None:r"""Handle graceful shutdown with configurable timeout. This is used tokeep the workforce running for a while to debug the failed task.diff --git a/examples/workforce/workforce_shared_memory_validation.py b/examples/workforce/workforce_shared_memory_validation.pyindex 34cce0d43..2de7c69b7 100644--- a/examples/workforce/workforce_shared_memory_validation.py+++ b/examples/workforce/workforce_shared_memory_validation.py@@ -392,7 +392,6 @@ if __name__ == "__main__":main()-"""================================================================================== Workforce Shared Memory Validation Test ===diff --git a/test/workforce/test_workforce.py b/test/workforce/test_workforce.pyindex 0de4d81dc..31c053ab2 100644--- a/test/workforce/test_workforce.py+++ b/test/workforce/test_workforce.py@@ -23,7 +23,6 @@ from camel.societies.workforce.task_channel import TaskChannelfrom camel.societies.workforce.workforce import Workforcefrom camel.tasks.task import Task, TaskStatefrom camel.types import ModelPlatformType, ModelType-from camel.utils import with_timeout_asyncclass TestTimeoutWorkforce(Workforce):@@ -47,7 +46,7 @@ async def test_with_timeout_function():# Test normal operation (successful completion)mock_coro = AsyncMock()mock_coro.return_value = "success"- result = await with_timeout_async(mock_coro(), context="test operation")+ result = await mock_coro()assert result == "success"# Test timeout handling@@ -55,11 +54,9 @@ async def test_with_timeout_function():mock_timeout_coro.side_effect = asyncio.TimeoutError("Simulated timeout")with pytest.raises(asyncio.TimeoutError) as exc_info:- await with_timeout_async(- mock_timeout_coro(), context="test timeout operation"- )+ await mock_timeout_coro()- assert "Timed out while test timeout operation" in str(exc_info.value)+ assert "Simulated timeout" in str(exc_info.value)@pytest.mark.asyncio@@ -189,21 +186,13 @@ async def test_workforce_with_timeout_integration():if not ran_once:ran_once = True# Post initial ready tasks- await with_timeout_async(- workforce._post_ready_tasks(),- context="posting ready tasks at start",- )+ await workforce._post_ready_tasks()# Get returned task- returned_task = await with_timeout_async(- workforce._get_returned_task(), context="getting returned task"- )+ returned_task = await workforce._get_returned_task()# Handle completed task- await with_timeout_async(- workforce._handle_completed_task(returned_task),- context="handling completed task",- )+ await workforce._handle_completed_task(returned_task)workforce._running = False