Files
crewAI/lib
Devin AI 6d4fcbd7ee fix: prioritize tool calls over text when available_functions is None
When LLMs like Anthropic return both text content AND tool calls in
the same response, the text response was being returned instead of
the tool calls when available_functions=None. This caused the executor
to treat the text as a final answer, discarding the tool calls.

The fix reorders the priority checks in all 4 response handlers
(_handle_non_streaming_response, _ahandle_non_streaming_response,
_handle_streaming_response, _ahandle_streaming_response) so that
tool calls are returned before falling back to text content when
available_functions is None.

Fixes #4788

Co-Authored-By: João <joao@crewai.com>
2026-03-09 13:45:12 +00:00
..