-
-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
Description
Mesa 4.x removed mesa.space entirely, which breaks the mesa-llm codebase with a ModuleNotFoundError on import. Running python -m pytest tests/ on a fresh Mesa 4.x install fails with 24 test failures.
Root Cause
The codebase uses the old Mesa 2.x/3.x space API:
from mesa.space import MultiGrid, SingleGrid, ContinuousSpace
These classes no longer exist in Mesa 4.x.
Fix
Migrate to the new Mesa 4.x APIs:
| Old | New |
|---|---|
mesa.space.MultiGrid |
mesa.discrete_space.OrthogonalMooreGrid |
mesa.space.SingleGrid |
mesa.discrete_space.OrthogonalMooreGrid |
mesa.space.ContinuousSpace |
mesa.experimental.continuous_space.ContinuousSpace |
grid.place_agent(agent, pos) |
agent.cell = grid._cells[pos] |
grid.get_neighbors() |
cell.get_neighborhood(radius=vision) |
model.steps |
model.step |
Result
All 203 tests passing after migration.
Files Affected
mesa_llm/llm_agent.pymesa_llm/tools/inbuilt_tools.pymesa_llm/recording/record_model.pytests/conftest.pytests/test_llm_agent.pytests/test_parallel_stepping.pytests/test_reasoning/test_cot.pytests/test_tools/test_inbuilt_tools.py
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels