mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-04 16:52:37 +00:00
When the same CrewAgentExecutor instance is reused across multiple sequential tasks, messages and iterations were accumulating instead of being reset. This caused duplicate system prompts, context window explosion, and eventually crashes with empty LLM responses. Reset self.messages and self.iterations at the start of invoke() and ainvoke() to ensure each task execution starts with a clean slate. Fixes #4319, #4389, #4415 Co-Authored-By: João <joao@crewai.com>