Skip to content

fix(agentchat): preserve TextMentionTermination sources on serialization - #8288

Open
澍 (icearia0219) wants to merge 1 commit into
microsoft:mainfrom
icearia0219:fix/text-mention-termination-sources
Open

澍 (icearia0219) wants to merge 1 commit into
microsoft:mainfrom
icearia0219:fix/text-mention-termination-sources

Conversation

@icearia0219

Copy link
Copy Markdown

Summary

  • Preserve TextMentionTermination.sources when dumping a component.
  • Restore the source filter when loading the component, including when nested inside a composite termination condition.
  • Default the config field to None so previously serialized configs remain loadable.

Fixes #8282

Validation

  • git diff --check passed.
  • Automated tests were not run.

Copilot AI lite review requested due to automatic review settings September 26, 2026 08:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Add regression tests covering source-filtered and composite serialization round-trips.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

Preserves TextMentionTermination.sources during serialization, including nested composite conditions.

Changes:

  • Adds optional, backward-compatible sources configuration.
  • Restores source filters when loading components.
  • Automated tests were not run.
File Summary
python/​packages/​autogen-agentchat/​src/​autogen_agentchat/​conditions/​_terminations.py Updates termination configuration serialization and restoration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +152 to +155
return TextMentionTerminationConfig(
text=self._termination_text,
sources=list(self._sources) if self._sources is not None else None,
)

This branch has not been deployed

No deployments
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.

TextMentionTermination(sources=...) drops sources on dump_component / load_component

2 participants