Skip to content

feat: support concurrent speakers in SelectorGroupChat#7388

Open
majiayu000 wants to merge 1 commit intomicrosoft:mainfrom
majiayu000:feat/issue-5395-concurrent-speakers
Open

feat: support concurrent speakers in SelectorGroupChat#7388
majiayu000 wants to merge 1 commit intomicrosoft:mainfrom
majiayu000:feat/issue-5395-concurrent-speakers

Conversation

@majiayu000
Copy link

Summary

Implements concurrent speaker support for SelectorGroupChat as outlined by @ekzhu in #5395:

  • selector_func can now return str | list[str] | None — returning a list selects multiple speakers to respond concurrently
  • New max_concurrent_speakers parameter (default 1) enables model-based multi-speaker selection
  • When multiple speakers are selected, all receive RequestToSpeak and must respond before the next selection round
  • allow_repeated_speaker=False now correctly excludes all previous concurrent speakers from the next round

Backwards compatible: default behavior is unchanged (max_concurrent_speakers=1, selector_func returning str | None).

Closes #5395

Changes

  • Updated SelectorFuncType signatures to accept str | list[str] | None return type
  • Added max_concurrent_speakers parameter to SelectorGroupChat and SelectorGroupChatManager
  • Added _select_multiple_speakers() method for model-based concurrent selection
  • Changed _previous_speaker: str | None_previous_speakers: list[str] for correct exclusion tracking
  • Updated SelectorManagerState with backwards-compatible previous_speakers field
  • Updated serialization (save_state/load_state) for backwards compatibility with existing state
  • Updated SelectorGroupChatConfig and _to_config/_from_config for declarative support

Test plan

  • All 30 existing selector tests pass (no regressions)
  • New test: test_selector_group_chat_concurrent_speakers_with_selector_func — selector_func returns ["agent1", "agent2"]
  • New test: test_selector_group_chat_concurrent_speakers_with_model — model returns "agent1, agent2" with max_concurrent_speakers=2
  • pyright: 0 errors, 0 warnings
  • Full test suite: 91/91 pass

Closes microsoft#5395

Signed-off-by: majiayu000 <1835304752@qq.com>
@majiayu000 majiayu000 marked this pull request as ready for review March 13, 2026 12:04
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.

[Python] SelectorGroupChat to support concurrent speakers

1 participant