Merge pull request #941 from crewAIInc/bugfix/minor-max-retry-recursion-fix

Properly capture result from max retry recursive call
This commit is contained in:
Brandon Hancock (bhancock_ai)
2024-07-16 22:05:58 -04:00
committed by GitHub

View File

@@ -181,7 +181,6 @@ class Agent(BaseAgent):
self.agent_executor.tools = parsed_tools
self.agent_executor.task = task
# TODO: COMPARE WITH ARGS AND WITHOUT ARGS
self.agent_executor.tools_description = self._render_text_description_and_args(
parsed_tools
)
@@ -204,7 +203,7 @@ class Agent(BaseAgent):
self._times_executed += 1
if self._times_executed > self.max_retry_limit:
raise e
self.execute_task(task, context, tools)
result = self.execute_task(task, context, tools)
if self.max_rpm:
self._rpm_controller.stop_rpm_counter()