Writing Stories / Rules for Unhappy Form Paths is inconsistent

I’m currently trying to add unhappy paths to handle the user asking about other things while a form is running, but it’s not working. I followed the logic from the docs to create a first unhappy path:

- rule: user asks windows
  condition:
    - active_loop: pchange_form
  steps:
    - intent: ask_windows
    - action: utter_list_windows
    - action: pchange_form #activate the pchange form to fill the other slots
    - active_loop: pchange_form

and this one works fine, but when I try writing another one this time it doesn’t trigger. For this case I want the user to be able to run a different request and then come back to the original form, so I have one rule for use outside forms and another like the unhappy path above:

#desc
- rule: tell desc
  condition:
    - active_loop: null
  steps:
  - intent: ask_desc
  - action: action_desc

#desc
- rule: tell desc interrupt
  condition:
    - active_loop: pchange_form
  steps:
    - intent: ask_desc
    - action: action_desc
    - action: utter_interrupt
    - action: pchange_form #activate the pchange form to fill the other slots
    - active_loop: pchange_form

I’ve tried without the active_loop: null, and it doens’t change anything.

On a sidenote, I want to do this for various forms so I’ll have to write unhappy paths for each form interruption, unless what was discussed here https://github.com/RasaHQ/rasa/issues/7318 is already implemented but i didn’t find anything.

Thank you for your help

shellDebug.txt (56.6 KB)

Thanks for the help…

If anyone is interested with the solution the problem is basically caused by the manipulation of slots in custom actions. This makes the bot behave weird and fail to follow rules despite the conditions being correct.

An easy workaround is to create a copy of the slot that you’re interested in and change the form to require this copy instead of the original slot. So before activating the form you copy the current value of the original slot into the copy slot and never touch the values of the copy slot.

1 Like