mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-04-11 05:22:41 +00:00
Add optional replan_on_failure and max_replans flags to the Crew class that enable the system to re-evaluate and update the execution plan when task results deviate from the original plan's assumptions. New components: - ReplanningEvaluator: lightweight LLM-based evaluator that checks whether a task result deviates significantly from the plan - CrewPlanner._handle_crew_replanning(): generates revised plans for remaining tasks based on actual results so far - Crew._maybe_replan(): hook called after each sync task completion in both _execute_tasks() and _aexecute_tasks() Backwards compatible: replan_on_failure defaults to False, so existing crews are completely unaffected. Co-Authored-By: João <joao@crewai.com>