We’ve all been there. You leave your LangGraph agent running overnight. It hits a 403 Forbidden on a scraping tool, or a REQUIRES_SINGLE_PART_NAMESPACE error on a SQL query.
Instead of failing gracefully, the agent asks the LLM for help. It gets stuck in a ReAct loop, burning through your API credits. Eventually, the native recursion_limit finally kills it.
But here is the worst part: the native recursion_limit is a blunt instrument.
When it hits the limit, LangGraph throws a GraphRecursionError. It crashes the run, wipes your checkpointed state, and returns a 500 error to your frontend user. You lose whatever partial data the agent did gather, and you get a surprise $4,000 API bill on Tuesday morning.
I spent the last month digging into why agents do this, especially with open-weight models (Qwen/Llama) that lack native self-correction. I realized that just throwing a raw RuntimeError or a "BLOCKED" string at an agent just confuses it, and it loops again.






