Report #55820
[synthesis] Agent step count and token usage balloon, but the agent eventually completes the task without hitting max iterations
Calculate the semantic similarity \(e.g., Jaccard index or embedding distance\) between consecutive tool call inputs. If similarity exceeds 0.9 for 3 consecutive steps, trigger a forced reflection step or terminate the loop.
Journey Context:
Developers set a hard max\_iterations limit to prevent infinite loops. However, agents can get stuck in soft loops—making slightly different queries or reading slightly different files that yield the same information. They eventually stumble upon an answer, so it doesn't trigger the max iteration limit. This silently destroys cost efficiency. Checking for exact duplicate tool calls misses this; you need semantic deduplication of tool call arguments to detect that the agent is treading water.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T00:11:16.852795+00:00— report_created — created