Skip to content

Support AssemblyAI inference context carryover#2057

Open
rosetta-livekit-bot[bot] wants to merge 5 commits into
mainfrom
interim-prevue-pate
Open

Support AssemblyAI inference context carryover#2057
rosetta-livekit-bot[bot] wants to merge 5 commits into
mainfrom
interim-prevue-pate

Conversation

@rosetta-livekit-bot

@rosetta-livekit-bot rosetta-livekit-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Port AssemblyAI inference STT agent_context carryover for supported U3 Pro family models.
  • Add the linked-source carryover controls, assistant-only 1,750-character tail truncation, and provider option typing.
  • Guard unsupported/disabled fallback children and synchronize forwarding across dynamic model transitions.
  • Add focused wire-payload, lifecycle, fallback, cleanup, and patch-release coverage.
Source diff coverage
Source file Classification Target coverage
livekit-agents/livekit/agents/inference/stt.py Ported agents/src/inference/stt.ts ports the linked PR's U3 Pro carryover model gate, option shape, capability wiring, and assistant-message forwarding. JS-specific safeguards prevent unsupported/disabled fallback children from being mutated and synchronize capability listeners across model changes.
tests/test_inference_stt_context.py Ported and expanded agents/src/inference/stt.test.ts covers capability gating, assistant-only forwarding, 1,750-character tail truncation, ignored items, active session.update wire payloads, supported/unsupported/supported/disabled transitions, and listener cleanup.

This PR is intentionally the lower stack. PR #2058 supersedes its temporary carryover-control surface with the current session-level Python architecture.

Validation

  • Exact head: efb7c37e0f6a630f8761f6abe4a274391e42ab09.
  • Focused STT/session/fallback tests passed: 129 passed, 1 skipped.
  • Package and full builds passed.
  • Isolated package lint passed with no errors and existing warnings; the normal linked-worktree command encountered duplicate ESLint plugin discovery.
  • Focused Prettier check passed.
  • Independent spec-compliance review approved.
  • Independent code-quality review approved.
  • Exact-head CI passed: Build, Test, Formatting, REUSE, Devin Review, and CLA.

Cue voice E2E

  • Session: sid_e3340fa16681.
  • Exact head: efb7c37e0f6a630f8761f6abe4a274391e42ab09.
  • Mode: Cue voice with real LiveKit room transport, voice injection/recording, and Cartesia sonic-3 through LiveKit inference TTS.
  • Controlled boundary: a protocol-compatible LiveKit inference WebSocket boundary captured exact STT session.create/session.update payloads and supplied deterministic transcripts; the LLM was deterministic.
  • Path-specific results: capability snapshots followed supported/unsupported/supported/disabled as true/false/true/false; only the supported transition forwarded. Unsupported, disabled, and user items never appeared in agent_context.
  • Request shaping: a 2,250-character assistant item produced exactly the final 1,750 B characters, SHA-256 a35f084996bba9fddefe6fb9be79b29763dc6ecc810fada308db8601777abf58.
  • Cleanup: conversation/capability listener counts changed from 1/1 while active to 0/0 after close.
  • Continuity: a second voice turn in the same session committed CONTINUITY-2057 and real TTS audio.
  • Artifacts: ~/.cue-cli/sessions/sid_e3340fa16681/events.jsonl, two command result.json files, session recording.wav, and both command WAVs. All were flushed and inspected directly.
  • Limitation: this captures production request shaping at a protocol-compatible boundary; it does not claim a production AssemblyAI network call.

Ported from livekit/agents#6466

Original PR description

already introduced in the assembly ai plugin

Post-rebase

  • Rebased/merged origin/main to clear conflicts in fallback_adapter.test.ts imports and agent_session.test.ts describe blocks.
  • Focused tests after merge: 101 passed, 1 skipped.
  • New exact head: efb7c37e0f6a630f8761f6abe4a274391e42ab09.

@rosetta-livekit-bot
rosetta-livekit-bot Bot requested a review from a team as a code owner July 18, 2026 00:55
@changeset-bot

changeset-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: efb7c37

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 38 packages
Name Type
@livekit/agents Patch
@livekit/agents-plugin-assemblyai Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-anthropic Patch
@livekit/agents-plugin-azure Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-cerebras Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-did Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-fishaudio Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-hume Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-liveavatar Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-minimax Patch
@livekit/agents-plugin-mistral Patch
@livekit/agents-plugin-mistralai Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-perplexity Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-protoface Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-runway Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugin-soniox Patch
@livekit/agents-plugin-tavus Patch
@livekit/agents-plugins-test Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugin-xai Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

devin-ai-integration[bot]

This comment was marked as resolved.

toubatbrian and others added 2 commits July 20, 2026 13:55
Guard provider updates by live capabilities and propagate model capability changes so sessions and fallback adapters forward context only while supported.

Co-authored-by: Cursor <cursoragent@cursor.com>
Cover the emitted session.update payload and the runtime previous_context_n_turns opt-out required by the Rosetta stack contract.

Co-authored-by: Cursor <cursoragent@cursor.com>
rosetta-livekit-bot Bot and others added 2 commits July 22, 2026 12:23
Co-authored-by: rosetta-livekit-bot[bot] <282703043+rosetta-livekit-bot[bot]@users.noreply.github.com>
Co-authored-by: Toubat <brian.yin@livekit.io>
Resolve conflicts by keeping both STT context-option and user-input
transcription tests, and by combining fallback-adapter test imports.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant