Better validation of action events #8127
Labels
area:rasa-oss/custom-actions
area:rasa-oss 🎡
Anything related to the open source Rasa framework
cse-issues
effort:atom-squad/4
Label which is used by the Rasa Atom squad to do internal estimation of task sizes.
type:bug 🐛
Inconsistencies or issues which will cause an issue or problem for users or implementors.
Rasa version: Tested on 2.3.4, bug should still exist on currently latest
main@eb408bb2d216de3a1cd1f72799d7b80eceeb1fd2
Rasa SDK version (if used & relevant): 2.3.1
Rasa X version (if used & relevant): 0.36.0 and later (not relevant however)
Python version: 3.8.6
Operating system (windows, osx, ...): Mac OS 11.2.1
Issue:
This came out of this Rasa X issue (see @tmbo's comment here for a summary).
The validation of action responses are quite optimistic, allowing actions to create invalid events (i.e.
"entities": {}
instead of the valid"entities": []
), resulting on a bunch of different issues downstream in Rasa X, since so far Rasa X seems to trust that events sent over the broker are valid.Here's a handy example repo made by @rgstephens to illustrate the issue: RasaHQ/action-execute-convo-issue. Note that this is actually a bug in the action code that should, however, be caught by Rasa OSS and have the error (invalid event) logged.
Definition of done
action_response_format_spec
method to cover in detail every top level key in the top 3 most important events:UserUttered
,SlotSet
,ActionExecuted
, while the rest 20 events can be covered on the surface, usingoneOf
json schema constraint (more details in Notion)server.py
action.py
The text was updated successfully, but these errors were encountered: