Skip to content

fix(xai): emit interim transcripts for in-progress status in realtime#6272

Merged
longcw merged 1 commit into
livekit:mainfrom
ByteMaster-1:fix/xai-plugin-sending-user-input-transcribed-completed-events-repeatedly
Jun 30, 2026
Merged

fix(xai): emit interim transcripts for in-progress status in realtime#6272
longcw merged 1 commit into
livekit:mainfrom
ByteMaster-1:fix/xai-plugin-sending-user-input-transcribed-completed-events-repeatedly

Conversation

@ByteMaster-1

Copy link
Copy Markdown
Contributor

Fixes #6271

xAI streams partial transcripts through the same conversation.item.input_audio_transcription.completed event as the final one, distinguishing them with a status field ("in_progress" vs "completed"). The handler delegated to the OpenAI base handler, which ignores status and always emits is_final=True, so every partial was surfaced as a final transcription and produced a duplicate conversation item for a single utterance.

Emit InputTranscriptionCompleted(is_final=False) for in-progress transcripts and only delegate to the base handler (is_final=True) for the final one. A missing status defaults to final.

xAI streams partial transcripts through the same conversation.item.input_audio_transcription.completed event as the final one, distinguishing them with a status field ("in_progress" vs "completed"). The handler delegated to the OpenAI base handler, which ignores status and always emits is_final=True, so every partial was surfaced as a final transcription and produced a duplicate conversation item for a single utterance.

Emit InputTranscriptionCompleted(is_final=False) for in-progress transcripts and only delegate to the base handler (is_final=True) for the final one. A missing status defaults to final.

Fixes livekit#6271
@ByteMaster-1 ByteMaster-1 requested a review from a team as a code owner June 29, 2026 12:35

@devin-ai-integration devin-ai-integration Bot left a comment

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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@longcw longcw left a comment

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.

thanks for the pr!

@longcw longcw merged commit 8b8c5ac into livekit:main Jun 30, 2026
18 checks passed
@ByteMaster-1 ByteMaster-1 deleted the fix/xai-plugin-sending-user-input-transcribed-completed-events-repeatedly branch July 1, 2026 09:20
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.

XAI :livekit-plugins-xai: RealtimeSession treats in-progress input transcriptions (status="in_progress") as final, duplicating user conversation items

2 participants