Skip to content

fix: add explicit type validation for participants in BaseGroupChat (#7580)#7597

Open
Dev-31 wants to merge 1 commit intomicrosoft:mainfrom
Dev-31:fix/7580-participants-type-validation
Open

fix: add explicit type validation for participants in BaseGroupChat (#7580)#7597
Dev-31 wants to merge 1 commit intomicrosoft:mainfrom
Dev-31:fix/7580-participants-type-validation

Conversation

@Dev-31
Copy link
Copy Markdown

@Dev-31 Dev-31 commented Apr 17, 2026

Fixes #7580.

Passing None, a string, an integer, or a list containing non-agent objects to any group chat constructor previously raised cryptic internal errors (e.g. TypeError: object of type 'NoneType' has no len()). This adds two isinstance guards in BaseGroupChat.__init__ before any existing checks, raising a clear TypeError that identifies the offending type or index. Applies to all subclasses (RoundRobinGroupChat, SelectorGroupChat, etc.) because they all delegate to the base class.

…icrosoft#7580)

Passing None, a string, an integer, or a list containing non-agent objects
to any group chat constructor previously raised cryptic internal errors
(e.g. TypeError: object of type 'NoneType' has no len()). This adds two
isinstance guards in BaseGroupChat.__init__ before any existing checks,
raising a clear TypeError that identifies the offending type or index.
Applies to all subclasses (RoundRobinGroupChat, SelectorGroupChat, etc.)
because they all delegate to the base class.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Dev-31
Copy link
Copy Markdown
Author

Dev-31 commented Apr 20, 2026

@microsoft-github-policy-service agree

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.

RoundRobinGroupChat raises raw AttributeError/TypeError for invalid participants instead of a clear validation error

1 participant