Skip to content

fix(voice): expose item_id on UserInputTranscribedEvent#6172

Open
DIYA73 wants to merge 2 commits into
livekit:mainfrom
DIYA73:fix/expose-item-id-6110
Open

fix(voice): expose item_id on UserInputTranscribedEvent#6172
DIYA73 wants to merge 2 commits into
livekit:mainfrom
DIYA73:fix/expose-item-id-6110

Conversation

@DIYA73

@DIYA73 DIYA73 commented Jun 20, 2026

Copy link
Copy Markdown

Closes #6110

What

Adds item_id: str | None = None to UserInputTranscribedEvent and forwards
ev.item_id from llm.InputTranscriptionCompleted in
AgentActivity._on_input_audio_transcription_completed.

Why

Realtime models (OpenAI/xAI/Gemini) emit multiple interim
user_input_transcribed events per utterance. InputTranscriptionCompleted
already carries a stable item_id to correlate these, but it was being
dropped when re-emitted as UserInputTranscribedEvent, forcing consumers to
either track state manually (impossible — the field wasn't exposed) or
subscribe to provider-specific raw events.

Testing

  • Added test_user_input_transcribed_event_item_id covering both the
    populated and default-None cases
  • ruff check / ruff format: clean
  • mypy (full project, 601 source files): 0 issues
  • Existing test suite: no regressions

Forward item_id from llm.InputTranscriptionCompleted to
UserInputTranscribedEvent, which was previously dropped when the
framework re-emitted the event upward. This lets consumers correlate
repeated interim transcription events belonging to the same utterance
(e.g. realtime models like OpenAI/xAI/Gemini emit multiple interim
events per utterance), enabling provider-agnostic dedup without
relying on provider-specific raw events.

Closes livekit#6110
@DIYA73 DIYA73 requested a review from a team as a code owner June 20, 2026 14:49
@CLAassistant

CLAassistant commented Jun 20, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@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 found 0 potential issues.

Open in Devin Review

@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 found 0 new potential issues.

Open in Devin Review

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.

Expose item_id (and speech-start timestamp) on UserInputTranscribedEvent for per-utterance dedup

2 participants