Skip to content

fix(voice): honor agent preemptive generation options#1796

Open
rosetta-livekit-bot[bot] wants to merge 1 commit into
1.5.0from
lariat-fainted-hatchway
Open

fix(voice): honor agent preemptive generation options#1796
rosetta-livekit-bot[bot] wants to merge 1 commit into
1.5.0from
lariat-fainted-hatchway

Conversation

@rosetta-livekit-bot

@rosetta-livekit-bot rosetta-livekit-bot Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • merge agent-level preemptiveGeneration options over resolved session options in AgentActivity
  • use the merged options for preemptive LLM generation and preemptive TTS
  • cover the upstream agent/session override cases in the existing preemptive-generation tests

Testing

  • pnpm test agents/src/voice/agent_activity.test.ts
  • pnpm exec prettier --check agents/src/voice/agent_activity.ts agents/src/voice/agent_activity.test.ts
  • pnpm build:agents

Ported from livekit/agents#6114

Original PR description

Closes #6112.

preemptive_generation was read directly from session.options, so an agent's turn_handling={"preemptive_generation": {...}} had no effect — the session value (default enabled: True) always won. This is inconsistent with endpointing, which already resolves agent-over-session via endpointing_opts.

This adds a preemptive_generation_opts property on AgentActivity that merges the agent's keys over the fully-resolved session value, and routes both call sites (on_preemptive_generation and the preemptive-TTS branch in pipeline_reply) through it.

Note this only fixes the effective behavior. The session report (make_session_report) still reflects session-level options only, so it won't show per-agent overrides; that reporting gap is tracked separately.

@changeset-bot

changeset-bot Bot commented Jun 16, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 06da8b3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@rosetta-livekit-bot rosetta-livekit-bot Bot requested a review from longcw June 16, 2026 04:52

@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

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.

0 participants