- Remove global _litellm_logger variable that could interfere with exception propagation
- Add proper error handling around logger.setLevel() operations
- Update tests to reflect removal of global caching
- Ensure context manager is fully isolated and doesn't affect validation methods
Co-Authored-By: João <joao@crewai.com>
- Cache litellm logger instance globally for performance optimization
- Implement more specific warning pattern filtering instead of broad matching
- Add robust error handling with graceful degradation in suppression
- Enhance streaming error handling with better logging and continue logic
- Add 3 new comprehensive tests:
- test_concurrent_llm_calls: Verify thread safety with concurrent LLM calls
- test_logger_caching_performance: Confirm logger instance caching works
- test_suppression_error_handling: Test graceful degradation on logger errors
- Fix all lint errors (unused imports) in test file
Co-Authored-By: João <joao@crewai.com>
- Remove FilteredStream class that globally hijacked sys.stdout and sys.stderr
- Replace with logging-based suppression using litellm logger level control
- Add contextual suppression around litellm.completion calls only
- Add comprehensive tests to verify fix and prevent regression
- Ensure streaming responses work correctly without interference
- Maintain litellm output filtering during LLM calls only
Co-Authored-By: João <joao@crewai.com>