early-butcher-66889
12/24/2025, 1:58 AMmaximum number of function calls steps reached - what is causing this - is it latency? Its like it lost its memory of the last call and keeps calling the same thing againtall-airline-16756
12/24/2025, 1:58 AMtall-airline-16756
12/24/2025, 1:58 AMmax_tool_steps = 3). This is not usually caused by network latency — the model still has the conversation context, but its reasoning + the tool outputs are causing repeated calls.
What commonly causes this behavior
• Overlapping or redundant tool definitions that confuse the model and make it call the same tool repeatedly.
• Vague or open-ended instructions to the model about when or how to call tools.
• Tool outputs that the model interprets as prompting another call (the tool’s response looks like an unresolved step).
• Complex/ambiguous user input that causes the model to iterate trying to resolve it.
What you can do now
• Make tool purpose and boundaries explicit (ensure each tool has a single clear responsibility).
• Clarify calling conditions in the prompt/instructions (when to call a tool and what to do with its output).
• Return a clear terminal signal from tools when no further calls are needed (e.g., “done”, structured result, or explicit flag).
• Reduce overlapping tools or combine similar ones so the model doesn’t flip between them.
• If the input is complex, break it into smaller steps so the agent doesn’t try to solve everything with repeated tool calls.
Quick diagnostic questions to narrow this down
1. Are your tools similar in name/purpose or returning unstructured text that might look like a follow-up request?
2. Do your tool outputs include an explicit “complete” indicator or structured fields the model can check?
3. Can you paste (or describe) the tool definitions and the last few turn exchanges where it loops?
Tell me the answers to those or paste the tool definitions + the agent’s recent messages and tool responses, and I’ll suggest concrete changes (prompts, schema, or tool edits) to stop the loop.
Sources: Agent session | LiveKit docs | Tool definition and use | LiveKit docs