-
-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
Parallel Stepping Conflict
mesa-llm enables parallel stepping by patching Mesa's AgentSet.shuffle_do.
When model.agents.step() is executed, it creates a single flat batch of all agents, which are then run concurrently.
The Conflict
The scheduler treats a MetaAgent M and one of its constituent agents A as independent peers and schedules them simultaneously.
If M internally triggers its agents:
for agent in self.agents:
agent.step()then A will be stepped twice in the same model tick:
- Once by the parallel scheduler
- Once by its parent MetaAgent
This leads to inconsistent state updates.
Fix: Create a "Team Badge" (is_component)
Introduce a small internal flag on agents called is_component.
self.is_component: bool = FalseMeaning:
False→ Independent agent (scheduled normally)True→ Component of another agent (not scheduled directly)
Behavior
The scheduler ignores agents where:
agent.is_component == TrueThis ensures that component agents are only stepped by their parent MetaAgent, preventing duplicate execution in a single tick.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels