Skip to content

fix(agentchat): accept message sequences as group chat tasks - #8424

Open
林SO (Linxiushen) wants to merge 1 commit into
microsoft:mainfrom
Linxiushen:codex/accept-sequence-group-chat-task
Open

林SO (Linxiushen) wants to merge 1 commit into
microsoft:mainfrom
Linxiushen:codex/accept-sequence-group-chat-task

Conversation

@Linxiushen

Copy link
Copy Markdown

Why are these changes needed?

BaseGroupChat.run() and run_stream() advertise Sequence[BaseChatMessage], but task validation only accepts lists. A tuple or collections.UserList of valid messages raises ValueError before the team runs.

Accept sequences in the existing validation branch and update both method docstrings. Parameterize the existing group-chat test over lists, tuples and UserList in both embedded and supplied runtimes. The test covers run(), a streamed rerun, message order, unchanged inputs, and empty/invalid-element rejection.

Related issue number

Fixes #8422

Validation

  • Unmodified base d07c667a3239ea4ab7af62a53b0f4ff205a1f23d: the new tuple/UserList cases fail in both runtimes; the two list controls pass (4 failed, 2 passed).
  • Fixed focused regressions: 6 passed. Entire test_group_chat.py: 91 passed on Windows, Python 3.12.14.
  • Workspace poe format --check and poe lint --no-fix pass. Mypy checks all 64 agentchat source/test files successfully using the package task's equivalent command with its config path quoted correctly; the Poe package wrapper splits this workspace's path at a space. Pyright on the two changed files and git diff --check also pass.
  • poe docs-build succeeds with 34 warnings, including missing optional extension dependencies. Notebook execution is disabled by the repository configuration.
  • Workspace poe mypy was attempted and stops in the unchanged agbench package with four errors involving missing stubs and Docker-related types. The full workspace check has not passed.

Core/agentchat were installed using frozen uv sync, with selected test/documentation dependencies added separately (the final installed package inventory is recorded). The 91 group-chat tests also pass after those additions. Full workspace/all-extras tests were not run. Tests use local echo/replay fixtures; no external model service was called.

AI assistance was used to prepare the change and run the recorded local checks.

Checks

  • I've included the relevant method docstring changes.
  • I've added tests corresponding to the changes introduced in this PR.
  • I've made sure all auto checks have passed.

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.

[Bug] BaseGroupChat.run() and run_stream() reject valid Sequence[BaseChatMessage] (e.g. tuples) despite type annotations

1 participant