Files
crewAI/lib
Devin AI 1459e6532c fix: prevent LLM stop words mutation causing output truncation in crew.kickoff()
The CrewAgentExecutor.__init__ was permanently mutating the shared LLM
object's stop attribute by adding executor-specific stop words (e.g.
'\nObservation:'). This caused BaseLLM._apply_stop_words() to truncate
ALL subsequent LLM responses at those stop words, even when stop words
were not intended for that call.

The fix:
- Stop words are now set on the LLM only for the duration of each
  invoke/ainvoke call and restored afterward via _set_llm_stop_words()
  and _restore_llm_stop_words() methods.
- _update_executor_parameters in Agent.core no longer mutates the
  shared LLM's stop attribute.

Fixes #4603

Co-Authored-By: João <joao@crewai.com>
2026-02-26 05:18:21 +00:00
..