-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
The RichLogHandler introduced in livekit-agents 1.3.x causes two regressions when stdout is piped (e.g., python main.py dev | tee log.txt):
- No colored output - Rich's TTY detection disables colors when piping
- Ctrl+C hangs -
BrokenPipeErrorduring shutdown prevents graceful termination
Both worked correctly in 1.2.17.
Expected Behavior
- Colored log output (as in 1.2.17)
- Ctrl+C gracefully terminates the process
Reproduction Steps
# Run agent with piped output
python main.py dev | tee -a debug.log
# Press Ctrl+C to stop
# Result: Process hangs, no colors in outputOperating System
macOS Tahoe
Models Used
Deepgram Nova-3, Cartesia
Package Versions
livekit==1.0.23
livekit-agents==1.3.10
livekit-api==1.0.7
livekit-blingfire==1.1.0
livekit-plugins-anthropic==1.3.10
livekit-plugins-cartesia==1.3.10
livekit-plugins-deepgram==1.3.10
livekit-plugins-elevenlabs==1.3.10
livekit-plugins-google==1.3.10
livekit-plugins-noise-cancellation==0.2.5
livekit-plugins-openai==1.3.10
livekit-plugins-silero==1.3.10
livekit-plugins-turn-detector==1.3.10
livekit-protocol==1.1.1Session/Room/Call IDs
Local dev environment
Proposed Solution
Additional Context
Issue 1: No Colors
Rich checks sys.stdout.isatty() which returns False when piping. This disables all color output.
Issue 2: Ctrl+C Hangs
When Ctrl+C is pressed while piping:
- SIGINT sent to process group
teemay terminate first, breaking the pipe- Rich attempts to write to broken pipe
- Rich's
on_broken_pipe()raisesSystemExit(1)(rich/console.py:1305) - This corrupts the shutdown sequence, causing hang
Traceback:
File ".../rich/console.py", line 1290, in _write_buffer
self.file.write(text)
BrokenPipeError: [Errno 32] Broken pipe
During handling of the above exception, another exception occurred:
...
File ".../rich/console.py", line 1305, in _write_buffer
raise SystemExit(1)
SystemExit: 1
Screenshots and Recordings
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working