Skip to content

[BUGF] Majorityvoting fix - #1203

Closed
Steve-Dusty wants to merge 2 commits into
kyegomez:masterfrom
Steve-Dusty:majorityvoting_fix
Closed

[BUGF] Majorityvoting fix#1203
Steve-Dusty wants to merge 2 commits into
kyegomez:masterfrom
Steve-Dusty:majorityvoting_fix

Conversation

@Steve-Dusty

@Steve-Dusty Steve-Dusty commented Nov 13, 2025

Copy link
Copy Markdown
Contributor

Fixed a bug where MajorityVoting was receiving an unexpected 'consensus_agent'
parameter from swarm_router that was being passed to Conversation.init(),
causing a 500 error in the API.

Changes:

  • Updated MajorityVoting.init() to accept and filter out MajorityVoting-specific
    parameters before passing kwargs to Conversation
  • Removed unused 'consensus_agent' parameter from swarm_router._create_majority_voting()
  • Added 'max_loops' parameter to swarm_router._create_majority_voting() for proper configuration

The consensus_agent parameter was never used - MajorityVoting always creates its own
internal consensus agent. All functionality remains identical and backward compatibility
is maintained.


📚 Documentation preview 📚: https://swarms--1203.org.readthedocs.build/en/1203/

consensus_agent_description: str = "An agent that uses consensus to generate a final answer.",
consensus_agent_model_name: str = "gpt-4.1",
additional_consensus_agent_kwargs: dict = {},
consensus_agent: Agent = None, # Accept but don't use this parameter for backward compatibility

Check failure

Code scanning / Pyre

Incompatible variable type Error

Incompatible variable type [9]: consensus_agent is declared to have type Agent but is used as type None.
@Steve-Dusty Steve-Dusty changed the title Majorityvoting fix [BUGF] Majorityvoting fix Nov 13, 2025
@kyegomez kyegomez closed this Nov 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants