feat(assemblyai): log connection lifecycle, silence, and session correlators#5476
Merged
tinalenguyen merged 3 commits intolivekit:mainfrom Apr 18, 2026
Merged
Conversation
…ilence detection Address visibility gaps reported by Portola — audio flows but no transcripts return with no log signal. Add session_id correlators on existing logs, log WebSocket connect/close lifecycle, periodic audio byte counters, warnings after 15s of recv silence, and logging of unhandled message types. URL is not logged (contains customer prompt/keyterms_prompt).
Previous cadence emitted a single warning at 15s and then went silent even if the stream stayed stuck. Now warns every 15s with the actual elapsed silent duration so ongoing stalls remain visible in logs.
Redundant with the recv-silence warning and per-turn speech_duration log already emitted at end-of-turn. If send_task completes ws.send_bytes, the bytes reached the socket — logging counts adds no diagnostic value.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the DEBUG logging added in #5146.
debugbeforews_connect(model + base_url; URL intentionally excluded since the query string contains customerprompt/keyterms_prompt) and after with the HTTP status.warningwithsession_id,close_code,msg.data,msg.extralogged before theAPIStatusErroris raised, so the close code is visible even if the exception gets swallowed downstream.warningwhen no message arrives from AAI for 15s, and re-emitted every 15s while silence continues (with the actual elapsed duration). Makes the "interims keep arriving but no finals" vs "AAI went quiet" distinction explicit.session=...added to every existing debug/error/exception log in_process_stream_eventandrecv_taskso logs can be cross-referenced with AAI-side logs.debuglog for unknowntypevalues, which were previously silently dropped.No impact at default log levels — all new output is
debugexcept the twowarning-level anomaly signals.Test plan
make format lint type-checkpassconnecting to AssemblyAI model=... base_url=...appears once at connectAssemblyAI WebSocket connected status=...appears oncesession=<id>