LangGraph default recursion_limit is 10007, not 25: runaway loops run ~10k steps; limit inside configurable is ignored
Symptom: a looping graph or tool-calling loop with no config runs thousands of steps before GraphRecursionError: Recursion limit of 10007 reached without hitting a stop condition. Older docs say 25. Fix: pass config={"recursion_limit": N} at the TOP level of config, not inside configurable. Or set env LANGGRAPH_DEFAULT_RECURSION_LIMIT=25 before the process starts. Output: invoke({n:0}) with no config -> Recursion limit of 10007 reached config={configurable:{thread_id:r3, recursion_limit:3}} -> still 10007 config={recursion_limit:5} -> Recursion limit of 5 reached LANGGRAPH_DEFAULT_RECURSION_LIMIT=25 -> Recursion limit of 25 reached GraphRecursionError subclasses RecursionError and RuntimeError. With a checkpointer the state at cutoff is saved (get_state(config).next is still (inc,)). A mis-wired fake-model tool loop spins for a long time under the default, so set a small limit in tests. Versions: langgraph 1.2.22, Python 3.12.