Repository navigation
Conversation
…attachments Restores the ts-voice lane's saved work (refs/recovery/att-b-voice-1111) onto the current TS attachment core: - Pipecat client events link to an authenticated server recording occurrence (reference only, no browser capture). - ElevenLabs STT Blob input and complete timestamped MP3 output attach through the shared provider manager. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…am writer - convert, stream and streamWithTimestamps feed only chunks the application already read (instrumentation-owned bridge) into startAttachmentStream; nothing is read ahead, teed or drained. - The stream finishes before the span ends so its reference projects; cancel, error, timeout, early break or over 4 MiB uploads nothing. - Non-MP3 output formats fail closed with source_unavailable. - Bound calls carry the shared media-owner context marker so wire-level capture can skip the same bytes. - Size and latency metadata keep their previous behaviour; test doubles mint 1 h sessions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New Node-only subpath @traceai/fi-instrumentation-livekit/agents:
bindLiveKitSessionRecording(session, ctx, { manager, agents,
ownedRecordingFiles, finalizationTimeoutMs, capture }).
- Never enables, starts, stops or deletes a recording. Chains the SDK's
own JobContext._onSessionEnd, which runs after AgentSession.close()
closed the RecorderIO and after the application's onSessionEnd, and
always runs the SDK step afterwards.
- Only the job's primary session, its own closed recorder and the fixed
audio.ogg in the job's session directory qualify; the file goes
through the core's owned-recording lease (identify, no-follow open,
identity bind, per-slice check) as tier single, direction mixed.
- Deny wins: core policy via public preflight at bind and again at
finalization, LiveKit project/session redaction, the
LIVEKIT_TELEMETRY_ALLOW_PII kill switch and session audio off.
- Exact supported versions 1.8.0, 1.8.1, 1.9.0-1.9.5; others report
unsupported_version. No package peer, so the lockfile is unchanged.
- CI job runs the real SDK (floor 1.8.0, latest 1.9.5) with its real
RecorderIO writing Ogg/Opus; the workflow gains workflow_dispatch.
- Pipecat: a throwing server-identity callback reports
source_unavailable without interrupting client callbacks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed assertion A failing assertion used to leave the SDK RecorderIO running, which kept the test process alive until the job timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The owned-file scope requires a canonical root; macOS's default temp directory sits under the /var symlink, so it fails closed there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 11, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd deny order - ElevenLabs: consumed streams now rely on the core's min(4 MiB, server single-upload limit) reservation, so servers whose max_upload_bytes is below 4 MiB admit them. Tests cover a 1 MiB server (real SDK floor and current), the exact-limit / limit+1 boundary, and the owned-budget concurrency (7 open 4 MiB streams, the 8th queue_full). README states the real concurrency instead of "many". - LiveKit Agents binding: the session-end policy re-check now runs first, before the SDK report is built and before any stat or open. New tests watch the session directory's fs calls and assert none happen before a deny (five tightening paths, with and without the file), plus a control, and reject a recording owned by another user. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…watch rmSync lstats the file it removes, so watching from before the removal recorded the test's own call. The watch now starts right before the session end it observes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Part of TH-2379 (Linear).
Summary
TypeScript voice attachments for LiveKit Agents, Pipecat and ElevenLabs, built on the shared attachment core in #677 (
feat/attachments-ts-core). Attachments stay off unless the provider's manager is enabled. A new recording is never started; these adapters only upload audio that already exists or that the application already read.@traceai/fi-instrumentation-livekit/agentswithbindLiveKitSessionRecording(session, ctx, { manager, agents, ownedRecordingFiles, finalizationTimeoutMs, capture }). At session end it uploads theaudio.oggthat LiveKit Agents' ownRecorderIOwrote.@traceai/fi-instrumentation-pipecatobservePipecatClient(client, { serverRecording })links client event spans to the server recording's trace and occurrence. It records nothing in the browser.@traceai/elevenlabsBlob, the completeconvertWithTimestampsMP3, and the MP3 fromconvert,streamandstreamWithTimestampsthat the application reads to the end (consumed-stream writer).V04: LiveKit Agents (Node) recording
record, never starts or stops the recorder, and never deletes the file.JobContext._onSessionEndand always runs the original afterwards. The order was confirmed by reading the source of 1.8.0 and 1.9.5:AgentSession.close()closes theRecorderIO;onSessionEndruns;ctx._onSessionEnd()runs, which is where the binding runs, before LiveKit's own report upload.audio.ogginctx.sessionDirectory. The report path is checked, but it does not grant permission on its own.single, directionmixed, purposeconversation_recording.preflightdenies, checked at bind and again at session end;LIVEKIT_TELEMETRY_ALLOW_PIIis false;unsupported_version.@livekit/agentsmodule, so this package never imports it.pnpm-lock.yamlis unchanged. Declaring an optional peer made a lockfile refresh add the whole Agents tree.finalizationTimeoutMs(at most 30 s). A late step after the deadline opens nothing and uploads nothing.V09: ElevenLabs consumed streams
max_upload_byteswhen that is lower. A partial file is never stored as if it were complete.source_unavailable.traceai.auto.attachment_owner.v1. Wire-level auto capture that honours the marker will not upload the same audio again.Additions in
fd7ffc41(mergesfeat/attachments-ts-coreat930876ea)930876ea: deferred targets, clamped stream reservation, unsampled and late-bind fixes). No voice adapter usesdeferredCorrelation()ortarget.bind(), so the new "bind()can return false when late" rule doesn't affect this PR. ElevenLabs attaches to its own span, LiveKit usesmanager.correlation(span), and Pipecat only adds a link.min(4 MiB, server max_upload_bytes). A server with a limit below 4 MiB now captures the stream (before this, it was deniedtoo_large). A body over the effective cap is still dropped whole (too_large).queue_full. The README used to say "many".lstat.convertandstreamupload on the floor SDK and the current SDK. With an exact 1 MiB body, one copy uploads; one byte more istoo_large.queue_full. Under a 1 MiB limit, 16 streams are admitted.fs/fs/promisescall in the session directory while the binding finalizes. A control row proves the watch sees thelstatandopen. Five ways of tightening policy after bind each deny with zero file calls, both with the file present and with it removed:invalidate.chowned to another uid (needs root; CI runs the suite as root) is rejectedsource_unavailable. So is a recording whose owner differs from the worker's uid (runs without root). Nothing is uploaded and the file is kept.Testing for these additions (private GCP VM, loopback-only networking, VM deleted)
The VM ran the
fd7ffc41tree:31409b33with thefd7ffc41test fix applied in place. The two trees are otherwise byte-identical.457a1553(old coref0a56b37):457a1553already had (deny before stat, uid check), and the mutations below prove they guard it.lstat: 10 rows fail;fd7ffc41: ElevenLabs, Pipecat, LiveKit (including Agents recording on 1.8.0 and 1.9.5, 40/40 each) and the TS attachment core all pass (dispatched; the workflows filter on PRs intodev/main).31409b33, failed 5 rows: the test's ownrmSync(which callslstat) ran inside the file watch.fd7ffc41starts the watch after the removal.Testing at
457a1553(private GCP VM, loopback-only networking; no network access beyond the loopback interface)RecorderIOwrites a real Ogg/Opusaudio.oggand the realJobContext._onSessionEndruns.ffprobedecodes them as opus.LIVEKIT_TELEMETRY_ALLOW_PII=0;isFilecheck. The core's no-follow open still rejects the symlink, so this is a layered check and the test still passes.50cb9956): ElevenLabs, Pipecat, LiveKit (including Agents recording on 1.8.0 and 1.9.5, 27/27 each) and the TS attachment core are all green.CI: the workflows filter on PRs into
dev/main, so I dispatched them on this branch.livekit-typescript-tests.ymlgainsworkflow_dispatchand a newagents-recordingjob (floor 1.8.0, latest 1.9.5).Not done (fails closed)
importCompletedRecording) exists, but no qualified Egress output reader or registry exists (backend B08READERSis empty; CQ-4). It stayssource_unavailable.singleapplies. Files above the single-upload cap aretoo_large.startRecordingwith a known sample format. Not wired;source_unavailable.🤖 Generated with Claude Code