Skip to content

Voice agent: no final response when max_tool_steps is reached #5009

@IanSteno

Description

@IanSteno

Bug summary

When max_tool_steps is reached during the voice agent tool-calling loop, the pipeline can return early without generating a final LLM response.

This can leave users with silence/no reply after one or more tool calls.

Affected area

  • livekit-agents/livekit/agents/voice/agent_activity.py

Repro/observations

  • In the tool loop, once step count exceeds configured max_tool_steps, current behavior logs a warning and returns
  • Tool results are already available in context, but no final text-only response is forced
  • End-user experience is an abrupt stop instead of a summarized answer

Why this is a bug

Hitting a tool-step limit should end tool execution, not user communication. The agent should produce a final response with gathered results rather than silently stopping.

Proposed fix

Tracked in PR:

That PR removes the silent early return behavior and forces a final non-tool LLM response when the limit is reached.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions