Skip to content

Commit

Permalink
fix: agent missing fix (#966)
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonbyte authored Jul 19, 2024
1 parent fcc57f2 commit f928829
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/crewai/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ def _execute_core(
tools: Optional[List[Any]],
) -> TaskOutput:
"""Run the core execution logic of the task."""
self.agent = agent
agent = agent or self.agent
self.agent = agent
if not agent:
raise Exception(
f"The task '{self.description}' has no agent assigned, therefore it can't be executed directly and should be executed in a Crew using a specific process that support that, like hierarchical."
Expand Down

0 comments on commit f928829

Please sign in to comment.