Skip to content

fix(voice): tolerate formatting changes in preemptive transcripts - #6667

Merged
theomonnom merged 3 commits into
livekit:mainfrom
swayamg20:fix/5766-soniox-stt-preemptive-generation
Aug 2, 2026
Merged

fix(voice): tolerate formatting changes in preemptive transcripts#6667
theomonnom merged 3 commits into
livekit:mainfrom
swayamg20:fix/5766-soniox-stt-preemptive-generation

Conversation

@swayamg20

@swayamg20 swayamg20 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • reuse preemptive generations when the final transcript differs only in casing, whitespace, or punctuation
  • reconcile the speculative user message with the finalized transcript and on_user_turn_completed edits before scheduling it
  • continue invalidating speculative generations when the recognized words or request context change
  • clarify the invalidation warning

Fixes #5766

Testing

  • uv run pytest tests/test_agent_session.py --unit -q -k preemptive_generation — 5 passed
  • uv run pytest --plugin soniox -q — 28 passed
  • make check

@swayamg20
swayamg20 requested a review from a team as a code owner August 2, 2026 11:09
devin-ai-integration[bot]

This comment was marked as resolved.

@theomonnom theomonnom left a comment

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.

lgtm. I'd remove the test file tho, it doesn't add much value, and it's a bit fragile since it relies on the logger.

@swayamg20

Copy link
Copy Markdown
Contributor Author

Thanks @theomonnom , sure, sounds right. Removing the test file.

@theomonnom

Copy link
Copy Markdown
Member

Thanks!

@theomonnom
theomonnom merged commit 4b4a12c into livekit:main Aug 2, 2026
14 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.

Preemtive generation still not working with Soniox STT (turn detection mode=STT)

2 participants