mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-18 12:28:15 +00:00
This addresses issue #4246 by adding optional debug logging that captures: - The raw LLM output that failed to parse (truncated to 500 chars) - The specific parsing error message - Retry count per agent turn - Agent role context for easier debugging The debug logging is controlled by Python's standard logging module at DEBUG level, allowing users to enable it via environment variables or log configuration. Changes: - Modified handle_output_parser_exception() in agent_utils.py to accept raw_output and agent_role parameters for debug logging - Updated CrewAgentExecutor._invoke_loop() and _ainvoke_loop() to pass raw output and agent role to the exception handler - Updated LiteAgent._invoke_loop() to pass raw output and agent role - Added comprehensive tests for the new debug logging functionality Co-Authored-By: João <joao@crewai.com>