diff --git a/lib/cli/src/crewai_cli/create_agent.py b/lib/cli/src/crewai_cli/create_agent.py index e40e8c0c8..c1c94e11f 100644 --- a/lib/cli/src/crewai_cli/create_agent.py +++ b/lib/cli/src/crewai_cli/create_agent.py @@ -776,7 +776,7 @@ def _setup_env(base: Path, llm_model: str) -> None: for details in ENV_VARS.get(provider, []) if "key_name" in details ) - if already_set and env_vars.get("MODEL"): + if already_set: return if provider in ENV_VARS: diff --git a/lib/crewai/tests/new_agent/test_new_agent.py b/lib/crewai/tests/new_agent/test_new_agent.py index 4f5a692f4..21c087b64 100644 --- a/lib/crewai/tests/new_agent/test_new_agent.py +++ b/lib/crewai/tests/new_agent/test_new_agent.py @@ -377,12 +377,13 @@ class TestDelegation: @patch("crewai.new_agent.executor.aget_llm_response") @pytest.mark.asyncio async def test_sync_delegation(self, mock_llm_response): - mock_llm_response.side_effect = [ - "Draft article about AI.", # writer's response - "Here is the summary based on the writer's output.", # manager's response - ] + mock_llm_response.return_value = "Draft article about AI." - writer = NewAgent(role="Writer", goal="Write articles") + writer = NewAgent( + role="Writer", + goal="Write articles", + settings={"planning_enabled": False}, + ) tool = DelegateToCoworkerTool(coworker=writer) result = tool._run(message="Write an article about AI")