Skip to content

fix(voice): treat silent agent turns as successful - #2258

Open
rosetta-livekit-bot[bot] wants to merge 3 commits into
mainfrom
flagrant-tracker-servers
Open

fix(voice): treat silent agent turns as successful#2258
rosetta-livekit-bot[bot] wants to merge 3 commits into
mainfrom
flagrant-tracker-servers

Conversation

@rosetta-livekit-bot

@rosetta-livekit-bot rosetta-livekit-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • treat an empty agent turn as a successful silent response instead of a run_input error
  • port the source end-to-end regression test through RemoteSession, SessionHost, and AgentSession
  • add a patch changeset for @livekit/agents

Ports livekit/agents#6779.

Source diff coverage
  • livekit-agents/livekit/agents/voice/remote_session.py: Adapted to agents/src/voice/remote_session.ts. Removed the equivalent empty-items error guard and ported the source explanation using TypeScript naming and comment style.
  • tests/test_run_input_errors.py: Adapted to agents/src/voice/remote_session.test.ts. Ported the source-added silent-turn test into the target's existing colocated remote-session suite, using its paired in-memory transports, JS FakeLLM, and RemoteSession.sendMessage counterpart. The assertion remains that the response item list is empty and no error is raised.
  • No source files were not applicable.

Validation

  • pnpm test agents (115 files, 1,589 passed, 5 skipped)
  • pnpm --filter @livekit/agents build
  • pnpm --filter @livekit/agents lint (passes with existing warnings)
  • pnpm exec prettier --check agents/src/voice/remote_session.ts agents/src/voice/remote_session.test.ts .changeset/silent-agent-turns.md
  • cue-cli text-mode runtime assertion with an intentionally silent dispatched agent: no error event and no assistant conversation item

Ported from livekit/agents#6779

Original PR description

Problem

SessionHost turns a run that produced no chat items into an error:

if not items_list and not error:
    error = "agent produced no response items"

The caller sees it as a raised RuntimeError, so the turn — and, in simulations, the whole job — is scored as an agent failure.

An empty turn is a legitimate outcome. An LLM can return a completion with no text and no tool calls, and every item-add site in agent_activity is guarded on non-empty text (if forwarded_text:), so nothing lands in the chat context or in RunResult.events.

Agents that induce this on purpose hit it reliably. A close-the-call tool whose output tells the model it has already said goodbye and should now say nothing gets exactly that:

OUT : "You've already said goodbye - do NOT give another farewell, sign-off,
       or filler. If the caller just asked a real question, answer it in one
       short sentence; otherwise say nothing."
USER: "Okay, thank you."        <- agent emits nothing, turn fails

Agent-side traces for that turn confirm the model, not the framework, produced the silence:

[agent_turn]  dur=0.28s  lk.interrupted=False
  [llm_node]    lk.response.text=''
    [llm_request] gen_ai.usage.output_tokens=1

One output token, empty response text, no tool call, not interrupted — and the transcript up to that point is complete and correct.

Fix

Report the empty item list and let the caller decide what the silence means. Simulation drivers already model a silent turn explicitly, so they can end the call cleanly instead of failing it.

Test

test_run_silent_turn_is_not_an_error drives a real AgentSession whose LLM returns an empty completion through SessionHostRemoteSession. Without the fix it fails with the exact production error:

RuntimeError: session request run_input failed: agent produced no response items

@rosetta-livekit-bot
rosetta-livekit-bot Bot requested a review from a team as a code owner August 11, 2026 03:45
@changeset-bot

changeset-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 04ba245

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

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