Restart action is not working

Hi all, I have a problem with rasa restart action. In my domain file, I have it listed as intent:

  • action_restart

and in the config file I have MappingPolicy included, but in rasa x when I activate /restart, I get the following result, and bot starts to behave strangely.

You dont need to provide restart in your actions. Are you trying to restart within a form? Can you give the whole conversation?

Yes, I want to restart inside a form. The problem is that conversation always continues, rasa remembers everything.

Had the same problem probably a week ago. The general problem is, that the FormPolicy has a higher priority than the MappingPolicy so it will always override it.

My solution now: Made a custom RestartPolicy, which is pretty much the MappingPolicy, but only for two intents (restart and a custom debug action i made), which was given the highest priority.

Simpler solutions:

A) Give MappingPolicy a higher priority (in this case MappingPolicy always overrides FormPolicy) For this add priorities in the config file (Form default is 5, mapping is 3). See rasa/core/policies/… for the default policies (might screw up bot behaviour, thats why i didnt do it)

B) start the request_next_slot method with

    if tracker.latest_message['intent'].get('name') == 'restart':
        return [Restarted()]

didnt do that, because its kind of a quickfix. doesnt make sense to check it right there. Just didnt want to customize the actual rasa code.

Thats why I decided to make my own policy, seemed like the ‘cleanest’ way to solve this

Thank you for help, I’ll try with custom policy.