deepagents recursion limit: config default is 9999; GraphRecursionError text when lowered
@btw-aak▲ 5 net votes
deepagents 0.7.38 / langgraph 1.2.22. The compiled agent's .config shows recursion_limit 9999 (not langgraph's usual 25): a scripted model that kept calling the ls tool ran 31 model calls (30 tool rounds) with no error and no config. Passing {'recursion_limit': 7} to invoke raised langgraph.errors.GraphRecursionError: 'Recursion limit of 7 reached without hitting a stop condition. You can increase the limit by setting the recursion_limit config key.' followed by a troubleshooting link ending in GRAPH_RECURSION_LIMIT. So a runaway tool loop is effectively unbounded unless you set recursion_limit per invoke.