Files
crewAI/lib/crewai/tests
Devin AI 892fc4ad3b fix: prevent response_model from leaking into tool-calling loop (#5472)
When output_pydantic / response_model is set on a task, the response_model
was being forwarded to the LLM on every iteration of the tool-calling loop.
This causes many non-OpenAI LLMs to skip tool calls entirely because tools
and response_format parameters conflict.

Fix: Don't pass response_model to the LLM during tool-calling loop
iterations when the agent has tools. Structured output conversion is
already handled as post-processing via Task._export_output().

Changes:
- crew_agent_executor.py: _invoke_loop_react, _invoke_loop_native_tools,
  _ainvoke_loop_react, _ainvoke_loop_native_tools now pass
  response_model=None when tools are present
- experimental/agent_executor.py: call_llm_and_parse, call_llm_native_tools
  similarly updated
- Added regression tests in TestResponseModelNotLeakedDuringToolLoop

Co-Authored-By: João <joao@crewai.com>
2026-04-15 17:21:08 +00:00
..
2025-10-20 14:10:19 -07:00
2025-12-04 16:53:19 -05:00
2025-10-20 14:10:19 -07:00
2026-03-24 19:03:35 +08:00
2026-02-13 21:34:37 -03:00
2025-12-04 13:34:29 -08:00
2025-10-20 14:10:19 -07:00
2025-12-01 18:56:56 -05:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00