diff --git a/lib/crewai/src/crewai/agents/crew_agent_executor.py b/lib/crewai/src/crewai/agents/crew_agent_executor.py index 9e36b4d91..a711b1d90 100644 --- a/lib/crewai/src/crewai/agents/crew_agent_executor.py +++ b/lib/crewai/src/crewai/agents/crew_agent_executor.py @@ -175,7 +175,9 @@ class CrewAgentExecutor(CrewAgentExecutorMixin): else self.stop ) ) - if merged_stop != (existing_stop if isinstance(existing_stop, list) else []): + if merged_stop != ( + existing_stop if isinstance(existing_stop, list) else [] + ): self.llm = copy.copy(self.llm) self.llm.stop = merged_stop diff --git a/lib/crewai/src/crewai/experimental/agent_executor.py b/lib/crewai/src/crewai/experimental/agent_executor.py index 3e1e859ae..dd76f2c55 100644 --- a/lib/crewai/src/crewai/experimental/agent_executor.py +++ b/lib/crewai/src/crewai/experimental/agent_executor.py @@ -269,7 +269,9 @@ class AgentExecutor(Flow[AgentExecutorState], CrewAgentExecutorMixin): else self.stop ) ) - if merged_stop != (existing_stop if isinstance(existing_stop, list) else []): + if merged_stop != ( + existing_stop if isinstance(existing_stop, list) else [] + ): self.llm = copy.copy(self.llm) self.llm.stop = merged_stop self._state = AgentExecutorState()