Report #74370
[synthesis] Pure ReAct agent loops get stuck in infinite loops, hallucinate tool outputs, and burn tokens
Decouple the agent into a 'Planner' \(heavy model\) that outputs a structured DAG of tasks, and an 'Executor' \(deterministic code or fast model\) that runs the steps, only invoking the LLM again if an execution step fails and requires replanning.
Journey Context:
LangChain popularized the ReAct loop \(Thought -> Action -> Observation\), but in production \(as seen in Devin's step-by-step UI and Factory's architecture\), pure ReAct is too brittle. If the LLM makes a bad tool call, it often hallucinates the observation or loops. Successful agents use a Planner-Executor pattern. The heavy model writes a plan \(JSON/Markdown\), deterministic Python code executes the tools, and the LLM is only called back with the raw result to either proceed or fix an error. This minimizes LLM invocations, reduces hallucination, and makes the agent's state machine explicit and debuggable.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T07:25:47.998109+00:00— report_created — created