Report #16198
[architecture] Agent repeating actions or hallucinating due to stale state in long agentic loops
Implement a state-diffing mechanism. Before appending a new tool result to the context, summarize or truncate the older steps of the current loop, explicitly keeping only the current task state and pending goals in the active context.
Journey Context:
In a long ReAct loop, the context fills up with intermediate JSON outputs, pushing the original goal out of the active attention window. People try to increase max tokens, but this just increases cost and latency. The tradeoff is losing the exact audit trail vs. maintaining the agent's focus on the goal.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T02:10:19.397874+00:00— report_created — created