Naming collision in meta-agents add_atrributes#3239
Merged
Conversation
|
Performance benchmarks:
|
add_atrributesadd_atrributes
quaquel
reviewed
Feb 4, 2026
Comment on lines
+214
to
+223
| # Prevent collision of attributes with meta-agent instantiation | ||
| mesa_primitives = [ | ||
| "unique_id", | ||
| "model", | ||
| "pos", | ||
| "name", | ||
| "random", | ||
| "rng", | ||
| ] | ||
|
|
Member
There was a problem hiding this comment.
I am fine with fixing it this way, but it is fragile. Any change on the model side has knock-on effects here.
Member
Author
There was a problem hiding this comment.
I can't disagree with it being fragile.
In preparation for a potential GSoC contributor I am rethinking the whole architecture.
quaquel
approved these changes
Feb 4, 2026
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
If users set
assume_consituting_agent_attirbutes=Trueincreate_meta_agentthis creates naming collision in mesaAgentattributes.Bug / Issue
Naming collisions will occur when new meta-agents are created and the meta-agent will assume critical attributes that mesa uses for bookkeeping For example, users create agent with
agent.unique_id=1 and thencreate_meta_agentwithassume_consituting_agent_attributes=Trueand agent 1 as aconstituting_agenta naming collision occurs and no meta_agentunique_idis now 1.Implementation
In the
add_attributesfunction addedmesa_primitives = [ "unique_id", "model", "pos", "name", "random", "rng", ]and then excluded these in attribute adoption loop and as well as_to ignore internal use only attributes.Testing
No testing changes
Additional Notes
With a planned focus on meta-agent, this is just a quick fix to address the immediate bug.
add_methodshas some protections to prevent a similar issue, but I did not give it a more thorough review to ensure they are sufficient.