Tracker gets restarted (action_session_start) after the first fallback

Hi, I’ve been using Rasa 2.8.x and 3.x and ran into this weird behavior between Rasa shell and using REST APIs.

I have 2 intents (greeting, profanity) and only one rule for profanity. domain-x.yml (283 Bytes)

Here are the steps when testing with REST APIs:

  1. Add message to tracker : “Hello” → detected intent was greeting
  2. Predict next action: the result is action_default_fallback as the intent doesn’t have rules or stories.
  3. Execute the action: action_default_fallback
  4. Predict next action again: this time it returned action_default_fallback again while the action should be action_listen when testing with Rasa shell or the message that makes the bot fallback was not the first message of a tracker.
  5. Even step 4 was not right, I tried to execute action_default_fallback
  6. Predict next action again: and it returned action_default_fallback
  7. same as 5
  8. same as 6
      1. …The bot got into an infinite loop.

I debugged and saw that the tracker was detected as a new session since applied_events() is empty (rasa/processor.py at 2.8.x · RasaHQ/rasa · GitHub), and action_session_start was executed. This also happened with Rasa interactive.

Below are the events of the tracker after step 4:

tracker.json (1.9 KB)

I wonder if this is a bug in Rasa’s implementation. Or the way I use REST APIs is not right or I have to handle that specific case when the bot fallbacks at the first message. If so, could you suggest solutions? Thanks.

One solution I have now is to stop predicting after action_default_fallback gets executed. In the example above, step 4 will be Execute action_listen, and step 5 is to wait for user input.