From b45cb7a93e6d560415a91730397e52b649303efd Mon Sep 17 00:00:00 2001 From: Greyson LaLonde Date: Tue, 4 Nov 2025 20:52:27 -0500 Subject: [PATCH] fix: set max reasoning attempts to address infinite loop --- lib/crewai/src/crewai/agent/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/crewai/src/crewai/agent/core.py b/lib/crewai/src/crewai/agent/core.py index 835fc2f87..5e755c7b7 100644 --- a/lib/crewai/src/crewai/agent/core.py +++ b/lib/crewai/src/crewai/agent/core.py @@ -166,9 +166,9 @@ class Agent(BaseAgent): default=False, description="Whether the agent should reflect and create a plan before executing a task.", ) - max_reasoning_attempts: int | None = Field( - default=None, - description="Maximum number of reasoning attempts before executing the task. If None, will try until ready.", + max_reasoning_attempts: int = Field( + default=15, + description="Maximum number of reasoning attempts before executing the task.", ) embedder: EmbedderConfig | None = Field( default=None,