Report #23894
[frontier] ReAct loops become non-deterministic and hard to debug with complex tool calling sequences
Replace implicit ReAct loops with explicit StateGraph: define nodes \(functions/tools\) and edges \(conditional transitions\) as a compiled graph, enabling breakpoints, cycles, and deterministic execution.
Journey Context:
The ReAct pattern \(Thought -> Action -> Observation loop\) is simple but becomes unmaintainable when tools have dependencies \(e.g., search must happen before summarize\). Naive implementations rely on the LLM to 'decide' the next step via scratchpad prompting, leading to infinite loops or incorrect ordering. StateGraph \(LangGraph\) treats the agent as a state machine: you define nodes \(python functions or LCEL chains\) and edges \(transition rules, including conditional edges based on state\). The graph is compiled into a runnable that executes deterministically. This enables features impossible in pure ReAct: persistent checkpoints \(save/resume\), human-in-the-loop breakpoints \(interrupt before a tool\), and cycles for retry logic. The key insight: LLM should decide \*which\* edge to take, not \*how\* to loop.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T18:31:08.451864+00:00— report_created — created