Repository navigation
Fix meta-agent class lookup typing - #4128
Merged
Merged
Conversation
Assisted-by: GPT-6
EwoutH
marked this pull request as ready for review
November 16, 2026 22:28
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.
Summary
Small follow-up fix in meta agents.
Bug / Issue
Follow-up to #4034 and #4034 (comment).
Implementation
Moves the cast to the existing-class lookup in
_create_meta_agent_instance()and removes the redundant cast from_build_meta_agent_class(). One source file changed.Testing
mypy --follow-imports=silent --ignore-missing-imports --no-incremental mesa/experimental/meta_agents/meta_agent.py mesa/experimental/meta_agents/meta_agents_api.py: errors decrease from five to one. The four errors introduced by typing: type hint meta-agent instance creation #4034 are resolved; the existing_membership_api.dissolveunion-attribute error remains.pytest -q -Werror -Wdefault::PendingDeprecationWarning tests/test_meta_agents.py tests/test_meta_agents_api.py tests/test_multi_level_meta_agents.py: 61 passed.git diff --checkpass.