Skip to content

Fix instruction template modality rendering#2030

Merged
toubatbrian merged 1 commit into
mainfrom
bestows-frailer-legions
Jul 14, 2026
Merged

Fix instruction template modality rendering#2030
toubatbrian merged 1 commit into
mainfrom
bestows-frailer-legions

Conversation

@rosetta-livekit-bot

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

Copy link
Copy Markdown
Contributor

Summary

  • Collapse identical Instructions.tpl audio/text variants to a single audio-only representation.
  • Preserve fully rendered modality-specific variants so renderInstructions(..., modality) does not duplicate template output.
  • Add the source PR's instruction-template regression coverage adapted to the JS tagged-template API.

Source diff coverage

Source diff coverage
Source file Classification Target file Notes
livekit-agents/livekit/agents/llm/chat_context.py Ported agents/src/llm/chat_context.ts Ported the resolve_template behavior to the JS counterpart, Instructions.tpl. JS stores fully rendered audio/text variants plus a current value instead of Python's common plus modality suffixes, so the target change collapses identical rendered variants by omitting text when audio === text.
tests/test_chat_ctx.py Ported agents/src/llm/chat_context.test.ts Ported the three source-added regression cases to Vitest using Instructions.tpl and renderInstructions, without adding unrelated new coverage.

Verification

  • pnpm test -- agents/src/llm/chat_context.test.ts passes.
  • pnpm build passes.
  • pnpm lint passes, with existing warnings.
  • pnpm test -- agents was run; it fails in existing AMD tests under agents/src/voice/amd.test.ts.
  • pnpm test -- agents/src/voice/amd.test.ts reproduces the same AMD failures in isolation, confirming they are unrelated to this instruction-template port.

No source infrastructure gap was identified.


Ported from livekit/agents#6414

Original PR description

Fixes #6407

Cue voice E2E

  • Strict voice-mode session: sid_7249cd3cd100 at head 3ff96430.
  • Spoken input traversed STT and the changed modality-template path; the persisted predicate resolved on PR2030_VERIFIED common=1 audio=1 text=0, proving one common marker, one audio marker, and no text marker.
  • TTS processed 145 characters and the session persisted framework events plus full-session and per-command WAV recordings under ~/.cue-cli/sessions/sid_7249cd3cd100/.

@rosetta-livekit-bot rosetta-livekit-bot Bot requested a review from a team as a code owner July 14, 2026 05:15
@changeset-bot

changeset-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3ff9643

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

This PR includes changesets to release 36 packages
Name Type
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-anthropic Patch
@livekit/agents-plugin-assemblyai 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-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

@rosetta-livekit-bot rosetta-livekit-bot Bot requested a review from longcw July 14, 2026 05:15

@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: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@toubatbrian toubatbrian enabled auto-merge (squash) July 14, 2026 23:06
@toubatbrian toubatbrian merged commit 206e884 into main Jul 14, 2026
9 checks passed
@toubatbrian toubatbrian deleted the bestows-frailer-legions branch July 14, 2026 23:06
@github-actions github-actions Bot mentioned this pull request Jul 14, 2026
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