Skip to content

chore(worker): update worker warnings AGT-2909#5771

Merged
chenghao-mou merged 2 commits into
mainfrom
chenghao/chore/clean-up-worker-warnings
May 21, 2026
Merged

chore(worker): update worker warnings AGT-2909#5771
chenghao-mou merged 2 commits into
mainfrom
chenghao/chore/clean-up-worker-warnings

Conversation

@chenghao-mou
Copy link
Copy Markdown
Member

No description provided.

@chenghao-mou chenghao-mou requested a review from a team May 19, 2026 15:05
Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment on lines 1099 to 1102
logger.warning(
f"failed to connect to livekit, retrying in {retry_delay}s", exc_info=e
f"failed to connect to livekit, retrying in {retry_delay}s",
extra={"retry_count": retry_count, "max_retry": self._max_retry, "error": e},
)
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.

🟡 Removal of exc_info loses exception traceback in connection retry warning logs

The change from exc_info=e to extra={"error": e} removes the full exception traceback from the warning log. With exc_info=e, Python's logging framework includes the complete traceback (showing causal chain, file/line info, etc.), which is critical for debugging why connections fail (DNS resolution errors, TLS failures, connection refused, etc.). With extra={"error": e}, only str(e) is included via the JsonFormatter.JsonEncoder (cli/log.py:98-99), losing the traceback entirely. Both exc_info and extra can be passed simultaneously to logger.warning(), so the new structured fields (retry_count, max_retry) can be added without sacrificing the traceback.

Suggested change
logger.warning(
f"failed to connect to livekit, retrying in {retry_delay}s", exc_info=e
f"failed to connect to livekit, retrying in {retry_delay}s",
extra={"retry_count": retry_count, "max_retry": self._max_retry, "error": e},
)
logger.warning(
f"failed to connect to livekit, retrying in {retry_delay}s",
exc_info=e,
extra={"retry_count": retry_count, "max_retry": self._max_retry},
)
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread livekit-agents/livekit/agents/worker.py Outdated
msg.type,
extra={
"type": msg.type.name,
"ws_extra": msg.extra,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think printing the data may even be more spammy?

I would only print it for error messages

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Do we send any non-error text messages?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Truncated the message. Since we only expect binary messages, a text message is most likely an error message.

@chenghao-mou chenghao-mou merged commit d5feb9d into main May 21, 2026
24 checks passed
@chenghao-mou chenghao-mou deleted the chenghao/chore/clean-up-worker-warnings branch May 21, 2026 08:07
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.

2 participants