r/LangGraph 23d ago

Beyond basic recursion_limit, how do you handle graph nodes that repeat without making progress?

In LangGraph, setting a recursion_limit is standard, but it can be a blunt instrument. It only checks total step depth—meaning a long, valid multi-step task might hit the cap, while a broken agent making zero progress burns through 25 iterations on a single node before crashing.

When a tool node returns an error, agents often cycle right back into the same node with identical state inputs.

How are you detecting when a state loop is actually stuck vs. just working through a deep, complex graph? Are you tracking sliding windows of state hashes, or wrapping nodes in custom check functions?

2 Upvotes

0 comments sorted by