Report #37699
[frontier] Agent stuck in infinite loops with unconstrained LLM decision-making at every step
Implement agents as explicit state machines or directed graphs where most transitions are deterministic code and LLM calls happen only at designated decision nodes. Define states, edges, and conditional routing upfront. Start with the simplest architecture and add LLM decision points only where needed.
Journey Context:
First-generation agent frameworks \(ReAct loops, AutoGPT\) gave the LLM full control over execution flow, leading to infinite loops, unexpected tool combinations, and unreproducible behavior. The emerging consensus from production deployments is to make workflows deterministic by default and only invoke LLM reasoning at specific decision points. This mirrors the structured programming revolution: goto \(free-form agent loops\) vs structured control flow \(state machine agents\). The tradeoff: graph-based agents require upfront design and are less flexible for truly open-ended tasks. But they are dramatically more reliable, debuggable, and cost-predictable. Anthropic's engineering guidance now recommends starting with a single LLM call, then adding a routing step, then tool use, and only reaching for full multi-step agent loops as a last resort. LangGraph has become the de facto implementation of this pattern, letting you define nodes \(functions\) and edges \(transitions\) with conditional routing based on LLM output.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T17:45:32.449439+00:00— report_created — created