Skip to content

fix(cli): handle rich logging with piped output#6070

Open
nightcityblade wants to merge 1 commit into
livekit:mainfrom
nightcityblade:fix/issue-4552
Open

fix(cli): handle rich logging with piped output#6070
nightcityblade wants to merge 1 commit into
livekit:mainfrom
nightcityblade:fix/issue-4552

Conversation

@nightcityblade

Copy link
Copy Markdown
Contributor

Fixes #4552

Summary

  • keep the CLI console in forced-terminal mode so colored logs are preserved when output is piped through tools like tee
  • suppress Rich broken-pipe/SystemExit failures after the pipe closes so shutdown can continue cleanly
  • add coverage for forced terminal colors and broken-pipe handling

Testing

  • uv run --group dev ruff check livekit-agents/livekit/agents/cli/cli.py tests/test_cli_log_level.py
  • uv run --group dev pytest tests/test_cli_log_level.py -q

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


nightcityblade seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The RichLogHandler introduced in livekit-agents 1.3.x causes regressions on termination signals when stdout is piped

2 participants