Restarting the bot does not close the open forms (Rasa 2)

Hi Rasa forum,

I am working on the financial demo bot from Rasa. The behavior of the bot after restarting is confusing and I couldn’t fix it with rules.

The problem happens when a form is open and in the middle of the form, the user wants to restart the bot. The expected behavior is that the bot closes all the forms and starts a new session. But in fact, after starting a new session it keeps asking for the requested slots from the previous session.

Here are the related snippets:

  1. In the rules, if I add action_deactivate_loop and the line after it before action_restart, I get an error for conflicting rules as the restart by default should be followed by action_restart. That’s why I have to deactivate the loops after action_restart. But it does not work.

    - rule: restart
       steps:
       - intent: restart
       - action: action_restart
       - action: action_deactivate_loop
       - active_loop: null
    
  2. Custom action for restart:

     class ActionRestart(Action):
    
         """Executes after restart of a session"""
    
         def name(self) -> Text:
    
             """Unique identifier of the action"""
    
             return "action_restart"
    
         async def run(
    
             self,
    
             dispatcher: CollectingDispatcher,
    
             tracker: Tracker,
    
             domain: Dict[Text, Any],
    
         ) -> List[EventType]:
    
             """Executes the custom action"""
    
             dispatcher.utter_message(template="utter_restart")
    
             return [
    
                 AllSlotsReset(),
    
                 Restarted()
    
             ]
    

In the domain file, carry_over_slots_to_new_session is set to false.

Any solutions would be appreciated.

I am facing an exact same issue. Did you get any solution?

Not really. Did you?