Skip to content

fix(xai): align realtime Voice Agent defaults and API coverage - #6755

Merged
tinalenguyen merged 11 commits into
livekit:mainfrom
damien-xai:fix/xai-realtime-voice-agent-parity
Aug 10, 2026
Merged

fix(xai): align realtime Voice Agent defaults and API coverage#6755
tinalenguyen merged 11 commits into
livekit:mainfrom
damien-xai:fix/xai-realtime-voice-agent-parity

Conversation

@damien-xai

Copy link
Copy Markdown
Contributor

Summary

  • Default xAI Realtime model to grok-voice-latest (resolves to grok-voice-think-fast-2.0) and default input transcription to grok-transcribe
  • Add force_message support via RealtimeSession.say() / supports_say, emit live caption updates from conversation.item.input_audio_transcription.updated, and forward reasoning / transcription / speed options
  • Expand live/unit coverage (including history delete + say smoke) and document the audit in livekit-xai-issues.md

Test plan

  • uv run pytest tests/test_realtime/test_xai_realtime_model.py -q --allow-uncategorized (20 passed)
  • XAI_API_KEY=… uv run pytest tests/test_realtime/test_realtime.py -k xai -q --allow-uncategorized (16 passed)
  • Live WS smoke: connect with grok-voice-latest, session.update (reasoning / idle_timeout / grok-transcribe), cancel, force_message, delete
  • CI unit gate on the PR

Made with Cursor

Default to grok-voice-latest with grok-transcribe, add force_message say(),
and handle live caption updates so the LiveKit plugin matches current xAI
Realtime behavior (and closes the Pipecat-era default-model gap).

Co-authored-by: Cursor <cursoragent@cursor.com>
@damien-xai
damien-xai requested a review from a team as a code owner August 7, 2026 23:19
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

devin-ai-integration[bot]

This comment was marked as resolved.

Co-authored-by: Cursor <cursoragent@cursor.com>
devin-ai-integration[bot]

This comment was marked as resolved.

damien-xai and others added 5 commits August 7, 2026 16:32
Match the OpenAI realtime cancellation path so interrupted force_message
calls do not leave has_active_generation stuck or mis-tag later responses.

Co-authored-by: Cursor <cursoragent@cursor.com>
Shrink the force_message/response.created race by only tagging replies
after the create is on the wire, and support overlapping say() calls.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid splitting the plugin module in this PR; behavior is unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
devin-ai-integration[bot]

This comment was marked as resolved.

Cancel/timeout previously cleared the pending say id before response.created,
so the base discard path never matched and cancelled scripted speech could still play.

Co-authored-by: Cursor <cursoragent@cursor.com>
devin-ai-integration[bot]

This comment was marked as resolved.

A bare cancel before force_message would silence an unrelated in-flight reply.

Co-authored-by: Cursor <cursoragent@cursor.com>
devin-ai-integration[bot]

This comment was marked as resolved.

Address review feedback: one async task owns send/wait/timeout/cancel,
kept in _say_tasks so it cannot be GC'd, and cancelled from aclose().

Co-authored-by: Cursor <cursoragent@cursor.com>
devin-ai-integration[bot]

This comment was marked as resolved.

aclose() cancelled the task and discarded by id but left the caller's
future pending, which could hang AgentActivity awaiting say().

Co-authored-by: Cursor <cursoragent@cursor.com>
@tinalenguyen
tinalenguyen merged commit ec00cda into livekit:main Aug 10, 2026
16 of 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.

3 participants