Commit Graph

2 Commits

Author SHA1 Message Date
Devin AI
352b213f7f fix: remove unused imports in test_rich_live_cleanup.py
Removes unused imports that were causing lint failures:
- logging
- io.StringIO
- unittest.mock.MagicMock
- rich.logging.RichHandler

This fixes the CI lint check failure (job 45782458300).

Co-Authored-By: Jo\u00E3o <joao@crewai.com>
2025-07-11 08:08:34 +00:00
Devin AI
20cdc92142 fix: properly cleanup Rich Live sessions after flow/crew completion
- Add stop_live() method to ConsoleFormatter to clean up Live sessions
- Call cleanup in FlowFinishedEvent and CrewKickoffCompletedEvent handlers
- Add comprehensive tests for Live session cleanup functionality
- Fixes issue #3136 where logging output was suppressed after CrewAI operations

The issue was that Rich Live sessions were not being explicitly stopped
when CrewAI flows or crews completed, leaving the terminal in a state
where subsequent logging output would be suppressed until process exit.

This fix ensures that Live sessions are properly cleaned up by:
1. Adding a stop_live() method that safely stops and clears Live sessions
2. Calling this cleanup method in the appropriate event handlers
3. Adding tests to prevent regression

Resolves #3136

Co-Authored-By: Jo\u00E3o <joao@crewai.com>
2025-07-11 08:04:32 +00:00