Skip to content

fix(autogen-agentchat): serialize TextMentionTermination sources filter - #8447

Open
电大老baby (HhH666-ux) wants to merge 1 commit into
microsoft:mainfrom
HhH666-ux:fix/text-mention-sources-roundtrip
Open

电大老baby (HhH666-ux) wants to merge 1 commit into
microsoft:mainfrom
HhH666-ux:fix/text-mention-sources-roundtrip

Conversation

@HhH666-ux

Copy link
Copy Markdown

Description

Fixes #8446.

TextMentionTermination(text, sources=[...]) silently lost its sources filter across dump_component() / load_component(): the config model only carried text, so a reconstructed condition terminated on the mention from any source instead of only the configured ones. Team-level roundtrips hit the same path because termination conditions are serialized as components inside SelectorGroupChatConfig and friends.

Changes

  • Add sources: List[str] | None = None to TextMentionTerminationConfig.
  • Pass sources through _to_config() and _from_config().
  • Regression test asserting the restored condition still filters by source, a double roundtrip preserves the filter, and the default sources=None survives as None.

Testing

$ pytest tests/test_termination_condition.py
14 passed in 0.97s

The repro script from #8446 now correctly returns None for a reloaded condition when the message source is outside sources.

dump_component() dropped the sources filter, so load_component()
reconstructed the condition without it and terminated on the text
mentioned by any source instead of only the configured ones. Team-level
dump/load roundtrips hit the same path via the serialized termination
condition component.

Add sources to TextMentionTerminationConfig and pass it through both
directions, with a roundtrip regression test.

Fixes microsoft#8446

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 loses its sources filter through dump/load roundtrip

1 participant