Skip to content

[Bug] Inbuilt move_one_step tool called unexpectedly when only domain tool is registered #254

@nancysangani

Description

@nancysangani

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions