Repository navigation
feat: Add instrumentation for LiveKit cascade mode - #2633
Merged
Merged
Conversation
David Elner (delner)
force-pushed
the
delner/livekit-cascade
branch
from
October 19, 2026 02:38
e27bb55 to
c0faf6e
Compare
David Elner (delner)
force-pushed
the
delner/livekit-cascade
branch
from
October 19, 2026 02:50
c0faf6e to
7a35afe
Compare
Luca Forstner (lforst)
left a comment
Member
There was a problem hiding this comment.
I find all the code to process WAVs a bit overkill and I think it could be solved more cleanly. I left a counter-proposal in slack: https://braintrustdata.slack.com/archives/C083GCUTVDZ/p1792414129468479?thread_ts=1792378384.092499&cid=C083GCUTVDZ
Luca Forstner (lforst)
added a commit
that referenced
this pull request
Oct 20, 2026
Luca Forstner (lforst)
added a commit
that referenced
this pull request
Oct 21, 2026
Luca Forstner (lforst)
added a commit
that referenced
this pull request
Oct 21, 2026
Luca Forstner (lforst)
added a commit
that referenced
this pull request
Oct 21, 2026
Luca Forstner (lforst)
added a commit
that referenced
this pull request
Oct 21, 2026
Luca Forstner (lforst)
added a commit
that referenced
this pull request
Oct 21, 2026
Rewrites the LiveKit plugin around a single Recording per session and a Playback per audio sink, and trims PcmAudio down to positioned writes. Recording now only turns on with BRAINTRUST_CAPTURE_ATTACHMENTS, and integrations.livekit is a plain boolean like every other integration. The LiveKitOptions object, the per-side audio env vars and the allowPii/OTel content gating are gone. The trace follows the voice design doc more closely: the root span is now `session`, final transcripts get their own `stt` spans with `transcribed_by` links, and recordings carry `timeline.basis` and `sources[].boundary`. Links still go in `metadata.links` because native rows have no top-level links field. Also fixes the output hook receiving `AgentOutput` instead of the session in auto mode, stops tool-only responses from logging an empty assistant message, and only re-publishes selections for spans that actually changed.
Luca Forstner (lforst)
force-pushed
the
delner/livekit-cascade
branch
from
October 21, 2026 09:43
64d7135 to
097ff10
Compare
The helper's methods took no parameters, so tsconfig.test.json rejected calls that pass attributes, statuses and times.
Luca Forstner (lforst)
approved these changes
Oct 21, 2026
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.
Trace LiveKit voice sessions in Braintrust, connecting user and agent turns with speech recognition, model responses, speech synthesis, and tool calls.
Support automatic instrumentation and a new
wrapLiveKitwrapper:With
BRAINTRUST_CAPTURE_ATTACHMENTS=true, capture incoming audio and agent audio actually played, linking recordings to speech spans and accounting for interruptions.Add
streamingAttachmentBufferBytesto configure audio attachment segment size, defaulting to 4 MiB.