Files
crewAI/tests
Devin AI d826b0ab52 Fix #5878: Preserve reasoning_content from DeepSeek thinking mode in conversation history
DeepSeek V4 models return reasoning_content alongside content when in thinking
mode. The API requires this field to be passed back in subsequent requests.
Previously, LLM.call() discarded reasoning_content and only returned the content
string, causing a 400 error on follow-up calls.

Changes:
- LLM.call(): Extract and store reasoning_content from the response message
- CrewAgentExecutor._format_msg(): Accept optional reasoning_content parameter
- CrewAgentExecutor._invoke_loop(): Include reasoning_content in assistant
  messages added to the conversation history

Tests added for:
- LLM storing reasoning_content from responses
- LLM returning None when reasoning_content is absent
- LLM resetting reasoning_content between calls
- Executor _format_msg including/excluding reasoning_content appropriately
- End-to-end invoke loop preserving reasoning_content in message history

Co-Authored-By: João <joao@crewai.com>
2026-05-21 05:10:38 +00:00
..
2024-12-17 16:00:15 -05:00
2024-11-18 00:21:36 -03:00
2024-12-23 13:19:58 -05:00
2023-10-29 19:51:59 -03:00
2023-12-27 15:13:42 -05:00