GROUP CHAT · TERMINATION CONDITIONS
AutoGen-style team: stop a conversation that never terminates
Run a writer and a critic in round-robin and see which termination condition fires: a keyword, a message cap, a token budget, or none.
Your experiment
A writer drafts a release note and a critic reviews it, alternating. The only stop condition is a text mention of APPROVE, and the critic’s first objection says it cannot APPROVE yet. Start there, then change how the critic words objections, when it approves, and which caps exist.
Play replays the computed run over sixty inspection seconds; Next event steps, Restart rewinds, and Inspection time scrubs. Any input change recomputes the run and rewinds it without autoplay.
Event trace
Computed data
Final metrics
Deterministic transcript model inspired by AutoGen AgentChat termination conditions (text mention, maximum messages, token usage); it is not AutoGen or a Java port and calls no model. Messages cost a fixed 300 (writer) or 120 (critic) tokens. The text check is a plain substring test. A run with no condition is cut at 40 messages and reported as a runaway.
A conversation needs an exit
Two agents take turns: the Writer drafts a release note and each revision costs 300 tokens, the Critic reviews and each review costs 120 tokens. A termination condition is checked after every message. Stop when a message contains APPROVE is a text-mention condition; Maximum messages and Token budget are caps. Critic approves on review number decides when, if ever, the critic writes APPROVE.
The opening run stops on a refusal
The critic’s first review says I cannot APPROVE this yet. The text-mention check is a substring test, so message 2 stops the chat after 420 tokens and an unapproved draft is returned: a premature stop. Clear Critic’s objections quote the word APPROVE so objections say Needs changes instead. Now the chat runs until the third review approves at message 6, after 1260 tokens. With approval on review 2 it stops at message 4 after 840 tokens.
A critic that never approves
Keep objections unquoted and set approval to Never. No condition fires and the conversation reaches the 40-message cut-off of this model with 8400 tokens: a runaway. Set Maximum messages to 10 and it stops after 10 messages and 2100 tokens without an approved draft. That is still a failure of the task, but a bounded one that the caller can see and handle.
Caps without the keyword
Restore approval on review 3, clear Stop when a message contains APPROVE and leave the caps at 0: the approval at message 6 is ignored and the run is a runaway again. Set Token budget to 2000: the chat stops after message 10, the first point where the running total reaches the budget (2100 tokens), and the result reports that the approval at message 6 was ignored. Caps bound cost; they do not detect success.
Reading the transcript and its limits
Play, Next event, Restart, Speed and Inspection time step through the messages, the stop and the verdict over sixty seconds; the transcript table lists every message with the running token total. The conditions mirror the text-mention, max-message and token-usage terminations in AutoGen AgentChat, but this is a deterministic model with scripted messages and no model calls. A robust setup combines a structured approval signal with a cap.