OFFIS-DAI / mango

Modular Python-based agent framework to implement multi-agent systems
https://mango-agents.readthedocs.io/
MIT License
12 stars 2 forks source link

if subscription for "handle_message" exists, do not execute generic handle_message function #120

Closed maurerle closed 2 weeks ago

maurerle commented 2 weeks ago

When a method was named handle_message but has a subscription as well (which was possible in mango 1.x as handle_message had no meaning for roles), the handling is executed twice. This is fixed here.

Though it might be a better approach to give user warnings in this case, as noone should add a subscribe to the method called handle_message.

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.57%. Comparing base (500c4d7) to head (f08a76f). Report is 4 commits behind head on development.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## development #120 +/- ## =============================================== + Coverage 88.55% 88.57% +0.01% =============================================== Files 22 22 Lines 2395 2399 +4 =============================================== + Hits 2121 2125 +4 Misses 274 274 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

rcschrg commented 2 weeks ago

I would propose a different approach, which makes more sense for me:

I think we should skip the new handle_message call if a subscription on handle_message exists, as a user I would not expect that my subscription is ignored while handle_message is called for every message without filtering. What do you think?

maurerle commented 2 weeks ago

Yes, that would be even better! :)