Skip to content

feat(voice): add configurable latency budget events - #7145

Open
bhargavikalicheti wants to merge 2 commits into
livekit:mainfrom
bhargavikalicheti:feat/6982-latency-budget
Open

feat(voice): add configurable latency budget events#7145
bhargavikalicheti wants to merge 2 commits into
livekit:mainfrom
bhargavikalicheti:feat/6982-latency-budget

Conversation

@bhargavikalicheti

Copy link
Copy Markdown

Summary
Adds configurable latency budgets for real-time agent turns.
Users can configure warning and maximum latency thresholds on AgentSession. The session emits a latency_budget event when the time between the end of user speech and the agent’s first output reaches either threshold.
Closes #6982.
Changes

  • Add LatencyBudgetOptions with required budget and optional warning thresholds.
  • Add public LatencyBudgetEvent.
  • Emit warning or exceeded events when the agent begins its first output.
  • Validate invalid or inconsistent threshold values.
  • Export the new types from the public package API.
  • Add unit and virtual-time integration tests.
    Testing
  • 94 passed
  • Ruff formatting passed.
  • Ruff linting passed.
  • git diff --check passed.

@bhargavikalicheti
bhargavikalicheti requested a review from a team as a code owner September 6, 2026 15:49
@CLAassistant

CLAassistant commented Sep 6, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@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 found 2 potential issues.

1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

Comment thread livekit-agents/livekit/agents/voice/agent_activity.py
Comment thread livekit-agents/livekit/agents/voice/agent_session.py
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.

Configurable Latency Budget Policies for Real-Time Agent Turns

2 participants