-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Form switching #7771
Form switching #7771
Conversation
Fix for issue #7751 to avoid that a form will re-ask for the slot prior to switching to another form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Core re-asks for slot upon form interruption
In my opinion this can't happen due to
rasa/rasa/core/actions/forms.py
Line 492 in cbed574
if await self.is_done(output_channel, nlg, tracker, domain, events_so_far): |
forms is first called for the original form. - The slot validation is called on the sentence that will trigger the form switching, but the original form is still active. The slot validation will fail and will also return ActionExecutionRejected event - Need to avoid raising the ActionExecutionRejected event too soon, because other slots might be set by the custom action. Reverted that change with a comment to clarify. - Need to avoid asking for the requested slot by checking if ActionExecutionRejected event was returned. The form is not yet done, so the is_done() method is still False.
It actually does happen, because the loop is first done with the original form still active.
I restored the logic to avoid raising the ActionExecutionRejected to quickly, so other slots set by the custom validation action will be set, but add an if statement that avoids the form asking for the next slot if ActionExecutionRejected was returned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Can you please add a changelog entry?
- I suggest merging to
2.2.x
as it's a bug fix - FYI: @nbeuchat is currently fixing similar parts with valide slots when coming back from unhappy paths #7764
Co-authored-by: Tobias Wochinger <[email protected]>
Co-authored-by: Tobias Wochinger <[email protected]>
Co-authored-by: Tobias Wochinger <[email protected]>
Co-authored-by: Tobias Wochinger <[email protected]>
Just re-request review once you you're done 🙌🏻 |
Co-authored-by: Tobias Wochinger <[email protected]>
Co-authored-by: Tobias Wochinger <[email protected]>
Co-authored-by: Tobias Wochinger <[email protected]>
Co-authored-by: Tobias Wochinger <[email protected]>
Co-authored-by: Tobias Wochinger <[email protected]>
- simpler call to PolicyPrediction, using all defaults - Build up an `events_expected` list as we go, and assert it against the tracker - Include the `BotUttered()` event in the `events_expected` list that is asserted.
@wochinge , |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 🚀 Nice work! Do you want to target 2.2.x so you can release a micro with the fix? Alternatively we're also releasing a minor on Thursday.
@wochinge , |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Nice work @ArjaanBuijk ! 💯 |
Proposed changes:
Fixes for two issues when switching forms:
Status (please check what you already did):
black
(please check Readme for instructions)