Files
crewAI/lib
Devin AI c3faffd868 fix: initialize tools_list and log warning in _resolve_native when no tools found
Fixes #5116. MCPToolResolver._resolve_native() could raise UnboundLocalError
when asyncio.run() raised a RuntimeError that didn't match the 'cancel scope'
or 'task' conditions — the exception was silently swallowed leaving tools_list
unbound.

Changes:
- Initialize tools_list to an empty list before the try block
- Add early return with warning log when tools_list is empty (matching
  the existing behavior in _resolve_external)

This covers three scenarios:
1. MCP server returns no tools
2. tool_filter removes all tools
3. RuntimeError swallowed without assigning tools_list

Co-Authored-By: João <joao@crewai.com>
2026-03-26 18:32:06 +00:00
..