Skip to content

fix: Reasoning.execute_tool_call() uses model.steps which does not exist in Mesa 4.x#206

Open
abhinavk0220 wants to merge 13 commits intomesa:mainfrom
abhinavk0220:fix/reasoning-mesa4x-steps-compat
Open

fix: Reasoning.execute_tool_call() uses model.steps which does not exist in Mesa 4.x#206
abhinavk0220 wants to merge 13 commits intomesa:mainfrom
abhinavk0220:fix/reasoning-mesa4x-steps-compat

Conversation

@abhinavk0220
Copy link

Summary

reasoning.py base class had self.agent.model.steps in both
execute_tool_call() and aexecute_tool_call(). model.steps does not
exist in Mesa 4.x this caused AttributeError on every tool call
execution across all reasoning strategies (CoT, ReAct, ReWOO).

Fix

# Before crashes in Mesa 4.x
plan = Plan(step=self.agent.model.steps, ...)

# After correct Mesa 4.x API
plan = Plan(step=int(getattr(self.agent.model, "_time", 0)), ...)

The same fix has already been applied in record_model.py (PR #195)
and st_lt_memory.py (PR #199) this completes the audit across
the full codebase.

Testing

All existing tests pass:

python -m pytest tests/ -q --ignore=tests/test_parallel_stepping.py
# 0 failures

AI Assistance Disclosure

This PR was developed with AI assistance (Claude) for code generation
and debugging. All code has been reviewed, tested, and understood by
the contributor.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 14, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: aecf0d2c-1f8a-4d12-874b-f04e193d4f83

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@souro26
Copy link

souro26 commented Mar 14, 2026

The PR includes several unrelated changes beyond model.steps compatibility fix mentioned in the description. Please keep each PR focused on a specific change.

@abhinavk0220
Copy link
Author

The PR includes several unrelated changes beyond model.steps compatibility fix mentioned in the description. Please keep each PR focused on a specific change.

Thanks for the feedback! You're right — this branch accumulated extra commits
from iterative debugging. I'll clean it up to only include the relevant changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants