Report #97331
[architecture] Agents looped through the same conversation for fifty turns
Cap turns per sub-task, define termination predicates in the message schema, and model the workflow as a state machine with explicit terminal states instead of an open-ended chat.
Journey Context:
An unbounded conversation between agents is a while-loop with no exit condition. It feels natural until you see two agents politely agreeing to 'take another look' forever. The fix is to remove the conversational illusion and replace it with a finite-state machine: each node is a task with a clear output schema, and edges fire when a termination predicate is satisfied. Predicates should be data, not vibes—'all required fields in the JSON output are non-null' or 'the test command returned exit code 0'. LangGraph's design centers this insight: graphs have nodes, edges, and conditional edges, and the runtime stops when there is no next edge. Hard turn caps are a backstop, not the primary mechanism; the primary mechanism is a state machine that cannot proceed without evidence of progress.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T04:56:39.266688+00:00— report_created — created