Skip to content

fix: preserve transcription item id#6120

Merged
davidzhao merged 1 commit into
livekit:mainfrom
nightcityblade:fix/issue-6109
Jun 28, 2026
Merged

fix: preserve transcription item id#6120
davidzhao merged 1 commit into
livekit:mainfrom
nightcityblade:fix/issue-6109

Conversation

@nightcityblade

Copy link
Copy Markdown
Contributor

Fixes #6109

Summary

  • expose item_id on UserInputTranscribedEvent
  • pass through realtime input transcription item IDs when re-emitting user transcription events
  • add a regression test for item ID propagation

Testing

  • uv run pytest tests/test_agent_session.py -q
  • uv run pytest tests/test_agent_session.py::test_realtime_user_input_transcription_preserves_item_id -q
  • uv run ruff check livekit-agents/livekit/agents/voice/events.py livekit-agents/livekit/agents/voice/agent_activity.py tests/test_agent_session.py

@nightcityblade nightcityblade requested a review from a team as a code owner June 16, 2026 03:14
@CLAassistant

CLAassistant commented Jun 16, 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

@areebkhan-tech

Copy link
Copy Markdown

it seems to have merge conflicts

@nightcityblade

Copy link
Copy Markdown
Contributor Author

Thanks for flagging it — I'm working through a rebase now. The branch drift turned out to be larger than expected, so I want to untangle it cleanly before I push an update.

@nightcityblade

Copy link
Copy Markdown
Contributor Author

Updated the branch to resolve the merge conflicts by merging the latest livekit/agents:main into fix/issue-6109 (no force-push).

Validation run:

  • uv run pytest tests/test_agent_session.py::test_realtime_user_input_transcription_preserves_item_id

The PR now reports as mergeable on GitHub. I also noticed the CLA check is still pending/not signed, which appears to be the remaining non-code item.

@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

@areebkhan-tech

Copy link
Copy Markdown

Hi, can u pls request re-review this has not been merged yet, or could it be you have not signed CLA yet .

Monkiia commented Jun 27, 2026

Copy link
Copy Markdown

I checked the branch again. The code change itself is already rebased and the targeted test passed in the last update; the remaining blocker appears to be the CLA status rather than an outstanding code review issue.

Once the CLA is recognized on GitHub, I'm happy to request re-review immediately.

@davidzhao

Copy link
Copy Markdown
Member

@nightcityblade could you please sign 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 new potential issues.

Open in Devin Review

@nightcityblade

Copy link
Copy Markdown
Contributor Author

I’m checking the CLA flow from this account now. The branch itself is already up to date and the targeted regression test passed in the last code update; once GitHub recognizes the CLA, I’ll request re-review immediately.

type: Literal["user_input_transcribed"] = "user_input_transcribed"
transcript: str
is_final: bool
item_id: str | None = None

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure we will need to expose even more fields in the future, extra seems more appropriate

Suggested change
item_id: str | None = None
extra: dict = {}

We can then do something like extra["openai"]["item_id"] ?

@davidzhao davidzhao merged commit 75916ce into livekit:main Jun 28, 2026
17 checks passed
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.

UserInputTranscribedEvent drops item_id, making per-utterance dedup of interim transcripts impossible without provider-specific events

6 participants