Repository navigation
Replies: 2 comments 3 replies
|
Hi @00yuyi00! I'm Dosu and I'm helping the Dify team. It depends on which Agent you're using:
For the repeated calls, check whether the preceding tool result contains a timeout/error or whether the model requests duplicates in the same round. That distinction would help separate a timeout problem from repeated model decisions. Which Dify version are you running, and could you share the Agent settings and one execution trace showing the repeated calls? To reply, just mention @dosu. Docs are dead. Just use Dosu. |
|
The knob you're looking for is Max Iterations in the Agent's execution settings — it's the documented safety limit that caps how many reasoning/tool cycles the agent runs per task ("sets a safety limit to prevent infinite loops"; guidance is 3–5 for simple tasks, 10–15 for complex ones — Agent node docs). Where it lives depends on which "new Agent" you're on:
Two notes on the specific loop you're seeing, since capping iterations treats the symptom:
And if the slow tool is a workflow-type tool you control, another structural option is to split it out: let the outer agent call a thin tool that triggers the slow part asynchronously and returns a job handle, then a second step retrieves the finished result — keeps the agent's iteration budget cheap regardless of latency. |
Uh oh!
There was an error while loading. Please reload this page.
Self Checks
Content
I'm using the new Agent in Dify. I've noticed that when the Agent thinks a tool hasn't returned its output in time, it keeps calling the tool repeatedly. However, the tool is actually just slow because one of its LLM nodes takes too long to think/generate, and it will eventually return a successful result. I'd like to limit the number of times the Agent can call tools. How can I do this? Is there a configuration option or parameter to set a maximum tool call limit?
All reactions