Skip to content

docs: add termination condition best practices guide#7600

Open
lawcontinue wants to merge 2 commits intomicrosoft:mainfrom
lawcontinue:docs/termination-best-practices
Open

docs: add termination condition best practices guide#7600
lawcontinue wants to merge 2 commits intomicrosoft:mainfrom
lawcontinue:docs/termination-best-practices

Conversation

@lawcontinue
Copy link
Copy Markdown

Addresses #5870

Summary

Adds a best practices guide for choosing termination conditions in AgentChat.

The existing termination tutorial covers the API, but doesn't guide users on when to use which condition. This is especially important because TextMentionTermination can be unreliable with tool-using agents — the model may never output the expected keyword in plain text.

What's added

  • New file: termination-best-practices.md in the agentchat user guide
    • When TextMentionTermination works (and when it doesn't)
    • Recommended pattern: always combine with deterministic conditions
    • Deterministic alternatives: MaxMessageTermination, SourceMatchTermination, HandoffTermination, ExternalTermination, TimeoutTermination, TokenUsageTermination
    • Stop-and-resume pattern for interactive web UIs
  • Updated: index.md to link the new guide

Testing

  • Built locally with sphinx — renders correctly
  • All code examples verified against autogen-agentchat 0.4 API

Related

Addresses microsoft#5870 - provides guidance on using deterministic termination
conditions as alternatives or complements to TextMentionTermination,
which can be unreliable with tool-using agents.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant