fix: return consistent List[str] from SwarmGroupChatManager.select_speaker#7582
Open
Ricardo-M-L wants to merge 1 commit intomicrosoft:mainfrom
Open
fix: return consistent List[str] from SwarmGroupChatManager.select_speaker#7582Ricardo-M-L wants to merge 1 commit intomicrosoft:mainfrom
Ricardo-M-L wants to merge 1 commit intomicrosoft:mainfrom
Conversation
…eaker The method returns List[str] when thread is empty (line 91) or when a HandoffMessage is found (line 97), but returns a bare str when no handoff message exists (line 98). This inconsistency can cause TypeError in callers expecting a uniform return type. Wrap the fallback return in a list to match the other return paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why Are These Changes Needed?
SwarmGroupChatManager.select_speaker()has inconsistent return types:[self._current_speaker](List[str])self._current_speaker(str)The return type annotation is
List[str] | str, but the docstring says "This method always returns a single speaker." Callers that process the result uniformly as a list will get a TypeError when the fallback path returns a bare string.Related issue number
N/A
Checks