Sitelet https://github.com/microsoft/autogen/pull/8075
Skip to content

fix: preserve MessageFilterAgent chronological order - #8075

Open
Zhewen Tan (tandede) wants to merge 1 commit into
microsoft:mainfrom
tandede:fix/message-filter-order
Open

fix: preserve MessageFilterAgent chronological order#8075
Zhewen Tan (tandede) wants to merge 1 commit into
microsoft:mainfrom
tandede:fix/message-filter-order

Conversation

@tandede

Copy link
Copy Markdown

Why are these changes needed?

MessageFilterAgent selected the correct messages for each source, but concatenated those selections in per_source configuration order. When source messages were interleaved, the wrapped agent therefore received a scrambled conversation timeline.

This change retains each selected message's original index and restores chronological order after all per-source filters have been applied. The existing first/last/count selection behavior remains unchanged.

A regression test reproduces the documented looping-agent case where a prior response from B must remain before A's newer revision.

Related issue number

Closes #7971

Checks

  • I've included any doc changes needed for https://microsoft.github.io/autogen/. No documentation change is required because this restores the behavior described by the existing example.
  • I've added tests (if relevant) corresponding to the changes introduced in this PR.
  • I've made sure all auto checks have passed.

Test plan

  • poe --directory packages/autogen-agentchat fmt (65 files unchanged)
  • poe --directory packages/autogen-agentchat lint
  • poe --directory packages/autogen-agentchat mypy (64 source files checked)
  • poe --directory packages/autogen-agentchat pyright (0 errors)
  • poe --directory packages/autogen-agentchat test (377 passed, 5 skipped)

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.

MessageFilterAgent orders filtered messages by per_source config order, not chronological order

1 participant