Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/frame-processor-client-sdk-info.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@livekit/agents': patch
---

Stop forwarding frame processor stream info and LiveKit credentials from room input handling.
20 changes: 0 additions & 20 deletions agents/src/voice/room_io/_input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export class ParticipantAudioInputStream extends AudioInput {

this.room.on(RoomEvent.TrackSubscribed, this.onTrackSubscribed);
this.room.on(RoomEvent.TrackUnpublished, this.onTrackUnpublished);
this.room.on(RoomEvent.TokenRefreshed, this.onTokenRefreshed);
}

setParticipant(participant: RemoteParticipant | string | null) {
Expand Down Expand Up @@ -153,27 +152,9 @@ export class ParticipantAudioInputStream extends AudioInput {
outputRate: this.sampleRate,
}),
);
this.frameProcessor?.onStreamInfoUpdated({
participantIdentity: participant.identity,
roomName: this.room.name!,
publicationSid: publication.sid!,
});
this.frameProcessor?.onCredentialsUpdated({
token: this.room.token!,
url: this.room.serverUrl!,
});
return true;

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.

🚩 FrameProcessor no longer receives stream context or credentials after track subscription

The removed code at agents/src/voice/room_io/_input.ts:155-164 (old lines) forwarded participant identity, room name, publication SID, token, and server URL to the FrameProcessor whenever a new track was subscribed, and refreshed credentials on token refresh. After this PR, the FrameProcessor still receives audio frames via AudioStream (agents/src/voice/room_io/_input.ts:159-164), but it no longer has access to the stream metadata or LiveKit credentials. If any FrameProcessor implementation (e.g., a cloud-based noise cancellation service) relies on these callbacks to authenticate or route audio, it would silently stop working. The changeset description explicitly states this is intentional, so this is likely coordinated with an update in @livekit/rtc-node where AudioStream now handles this internally. Worth confirming with the rtc-node team that the FrameProcessor contract no longer requires these calls.

Open in Devin Review

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

};

private onTokenRefreshed = () => {
if (this.room.token && this.room.serverUrl) {
this.frameProcessor?.onCredentialsUpdated({
token: this.room.token,
url: this.room.serverUrl,
});
}
};

private createStream(track: RemoteTrack): ReadableStream<AudioFrame> {
return new AudioStream(track, {
sampleRate: this.sampleRate,
Expand All @@ -186,7 +167,6 @@ export class ParticipantAudioInputStream extends AudioInput {
override async close() {
this.room.off(RoomEvent.TrackSubscribed, this.onTrackSubscribed);
this.room.off(RoomEvent.TrackUnpublished, this.onTrackUnpublished);
this.room.off(RoomEvent.TokenRefreshed, this.onTokenRefreshed);
this.closeStream();
await super.close();

Expand Down
Loading