Environment
- mesa-llm: 0.3.0
- mesa: latest
- Python: 3.x
- Provider: groq/llama-3.1-8b-instant
Description
When an agent registers only a single domain-specific tool
(e.g. adopt_opinion), the executor sometimes calls an inbuilt
tool (move_one_step) instead — even when the prompt has nothing
to do with movement.
Minimal reproduction
Found while building an opinion spread POC model:
https://github.com/nancysangani/GSoC-learning-space/blob/main/models/opinion_spread/model.py
Agent 6, Step 2:
- Agent is prompted to decide whether to adopt a neighbor's opinion
- CoT reasoning concludes: "I will express continued support for Universal healthcare"
- Plan-Execution calls:
move_one_step(direction="NorthEast")
- Result: agent physically moves on the grid instead of making an opinion decision
Root cause hypothesis
mesa-llm registers inbuilt tools (including move_one_step) globally
by default via ToolManager. When tool_choice="required" forces the
executor to call something, the LLM picks from all available tools —
including inbuilt ones the user never intended to expose for this task.
Suggested fix
Option A: Do not register inbuilt tools globally by default — require
explicit opt-in via tool_manager.register(move_one_step)
Option B: Add a tools_whitelist parameter to reasoning.plan() so
the user can restrict which tools the executor can pick from
Option C: Warn the user at agent init time which inbuilt tools are
auto-registered, so the behavior is not surprising
Environment
Description
When an agent registers only a single domain-specific tool
(e.g.
adopt_opinion), the executor sometimes calls an inbuilttool (
move_one_step) instead — even when the prompt has nothingto do with movement.
Minimal reproduction
Found while building an opinion spread POC model:
https://github.com/nancysangani/GSoC-learning-space/blob/main/models/opinion_spread/model.py
Agent 6, Step 2:
move_one_step(direction="NorthEast")Root cause hypothesis
mesa-llmregisters inbuilt tools (includingmove_one_step) globallyby default via
ToolManager. Whentool_choice="required"forces theexecutor to call something, the LLM picks from all available tools —
including inbuilt ones the user never intended to expose for this task.
Suggested fix
Option A: Do not register inbuilt tools globally by default — require
explicit opt-in via
tool_manager.register(move_one_step)Option B: Add a
tools_whitelistparameter toreasoning.plan()sothe user can restrict which tools the executor can pick from
Option C: Warn the user at agent init time which inbuilt tools are
auto-registered, so the behavior is not surprising