Skip to content

feat(avatar): add AvatarMetrics#1537

Open
rosetta-livekit-bot[bot] wants to merge 2 commits into
mainfrom
hounding-using-theme
Open

feat(avatar): add AvatarMetrics#1537
rosetta-livekit-bot[bot] wants to merge 2 commits into
mainfrom
hounding-using-theme

Conversation

@rosetta-livekit-bot
Copy link
Copy Markdown
Contributor

@rosetta-livekit-bot rosetta-livekit-bot Bot commented May 18, 2026

Summary

  • Add AvatarMetrics emitting avatar_join_latency (session start → avatar participant joined with video track) and playback_latency (first audio frame forwarded → playback started).
  • Wire metric emission into the base AvatarSession so all avatar plugins emit metrics_collected without per-plugin code.
  • Make avatar_identity an abstract property and add an overridable provider property; apply both across all 13 avatar plugins (tavus, bey, anam, simli, avatario, avatartalk, liveavatar, lemonslice, runway, keyframe, did, trugen, bithuman).

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 18, 2026

🦋 Changeset detected

Latest commit: 9cea79b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 31 packages
Name Type
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-liveavatar Patch
@livekit/agents-plugin-runway Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugin-assemblyai Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-cerebras Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-fishaudio Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-hume Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-minimax Patch
@livekit/agents-plugin-mistral Patch
@livekit/agents-plugin-mistralai Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugins-test Patch
@livekit/agents-plugin-xai Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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 5 additional findings in Devin Review.

Open in Devin Review

Comment thread agents/src/utils.ts
*/
signal?: AbortSignal;
}): Promise<RemoteTrackPublication> {
includeLocal?: boolean;
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.

🟡 waitForTrackPublication second overload uses includeLocal?: boolean instead of includeLocal?: false, creating a type-safety hole

The second overload of waitForTrackPublication at agents/src/utils.ts:1101 declares includeLocal?: boolean, while the analogous second overload of waitForParticipant at agents/src/utils.ts:975 correctly uses includeLocal?: false. This inconsistency creates a type-safety hole: when a caller passes a boolean variable (not a literal true), TypeScript's overload resolution skips the first overload (includeLocal: true) because boolean is not assignable to the literal true, and matches the second overload instead, returning Promise<RemoteTrackPublication>. However, the implementation may actually return a LocalTrackPublication at runtime since includeLocal is truthy.

Example showing the type hole
const flag: boolean = getIncludeLocal(); // evaluates to true
// TypeScript resolves to second overload → Promise<RemoteTrackPublication>
const pub = await waitForTrackPublication({ room, kind, includeLocal: flag });
// pub is typed as RemoteTrackPublication but could be LocalTrackPublication
pub.subscribed; // property that may not exist on LocalTrackPublication
Suggested change
includeLocal?: boolean;
includeLocal?: false;
Open in Devin Review

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

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.

1 participant