salmon-lighter-12882
07/22/2025, 2:02 PMtall-airline-16756
07/22/2025, 2:03 PMtall-airline-16756
07/22/2025, 2:03 PMlivekit.agents - WARNING - maximum number of function calls steps reached means your agent has exceeded the allowed number of consecutive tool/function calls in a single turn. By default, this limit (max_tool_steps) is set to 3. When the agent tries to execute more than this, further tool calls are halted for that turn as a safety measure.
How to resolve:
• Increase the limit: If your workflow requires more tool calls, you can raise the max_tool_steps parameter when creating your AgentSession (e.g., max_tool_steps=5).
• Review your tool logic: Check for possible infinite loops or circular dependencies between tools. Consolidate tool calls where possible to avoid unnecessary chaining.
• Understand the safety mechanism: This limit prevents runaway execution and resource exhaustion. The agent will continue to function in subsequent turns, but the current turn's tool execution is stopped when the limit is reached.
This warning is informational and helps you optimize your agent's tool usage patterns.
Sources: livekit-agents/livekit/agents/worker.py