-
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
Fix user ID always default on every shell session. #5117
Fix user ID always default on every shell session. #5117
Conversation
Thanks for submitting this PR, we'll give it a review as soon as possible. |
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.
I think the change makes sense in general - please have a look at the comments.
Would you mind adding a changelog entry? You can find the instructions in the README (you'll have to create an issue for reference in the changelog entry).
Thanks a lot for your contribution! 🎉
rasa/core/channels/console.py
Outdated
@@ -22,6 +22,8 @@ | |||
|
|||
DEFAULT_STREAM_READING_TIMEOUT_IN_SECONDS = 10 | |||
|
|||
CONSOLE_SESSION_USER_ID = str(uuid.uuid4()) |
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.
we use the hex
version of UUID4 elsewhere - it would be good to keep that consistent
CONSOLE_SESSION_USER_ID = str(uuid.uuid4()) | |
CONSOLE_SESSION_USER_ID = uuid.uuid4().hex |
Co-Authored-By: ricwo <ric.wkr@gmail.com>
Co-Authored-By: ricwo <ric.wkr@gmail.com>
Co-Authored-By: ricwo <ric.wkr@gmail.com>
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.
Thanks a lot for the changes 👍
Co-Authored-By: ricwo <ric.wkr@gmail.com>
Co-Authored-By: ricwo <ric.wkr@gmail.com>
@VictorCoCo can you please make sure |
@ricwo do you think it is worth it to be able to configure the id being set the same every time (or set a specific id, with default random)? I'm wondering if there is anyone who is currently banking on pulling the tracker from "default" every time who will have trouble in the future with an unpredictable conversation ID, especially in a script to pull trackers. |
@erohmensing Do you think passing the sender_id to the shell command as an optional argument would help? |
yes @erohmensing @VictorCoCo I think that is reasonable - as you suggested the easiest thing would be to add a command-line argument to |
@erohmensing Added
missed your comment, will change --sender-id to --conversation-id |
@VictorCoCo can you please make sure all tests pass? feel free to request a review from me again afterwards |
Co-Authored-By: ricwo <ric.wkr@gmail.com>
Co-Authored-By: ricwo <ric.wkr@gmail.com>
Co-Authored-By: ricwo <ric.wkr@gmail.com>
Co-Authored-By: ricwo <ric.wkr@gmail.com>
Co-Authored-By: ricwo <ric.wkr@gmail.com>
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 great, thanks for your changes 👍
Co-Authored-By: ricwo <ric.wkr@gmail.com>
Co-Authored-By: ricwo <ric.wkr@gmail.com>
@VictorCoCo would you mind fixing the failing build? |
I see only an issue on code climate, an unrelated code issue. Maybe a permission issue, Do you want me to squash it? |
rasa/constants.py
Outdated
@@ -59,3 +59,5 @@ | |||
|
|||
DEFAULT_SESSION_EXPIRATION_TIME_IN_MINUTES = 60 | |||
DEFAULT_CARRY_OVER_SLOTS_TO_NEW_SESSION = True | |||
|
|||
DEFAULT_SENDER_ID = "default" |
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.
@ricwo Would it be better to default to generating a random ID when rasa shell
is called instead of fixing it here as a constant?
The reason for this suggestion is: If you have a persistent tracker store and run rasa shell
, you would want to start from scratch with a new conversation id and not at whichever state the last session with a default id was in.
(We were also discussing that in the PR that adds such an argument for rasa interactive
: #5243.)
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.
I agree, It was the way I first changed it. @ricwo @erohmensing I am ok with changing it, What is your opinion?
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.
@chkoss yes but this is a separate functionality and should probably be controlled with a different command-line argument, something like --assign-random-conversation-id
@VictorCoCo your initial implementation assigned a random user ID with every new shell session, and made it impossible to use a deterministic one. being able to define a conversation ID as a command-line argument and having the script choose a random one are two separate issues. whatever the default behaviour, there needs to remain the possibility of a deterministic conversation ID
@VictorCoCo we'd love to make this part of the next release next week. Regarding the discussion, I think we should be consistent. By default we should generate a random id. If the user wants to use a specifc one, they can use Do you mind changing that? Otherwise the PR looks great and we are ready to merge 🚀 |
inconsistend API, needs to be fixed before merge
Great decision. I will make the changes until Monday. |
Perfect - we'll cut the release on Tuesday so Monday sounds great. Please shoot me a message once you are ready 🙂 |
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.
great work @VictorCoCo thanks a lot for jumping on this and getting the change ready to be merged 🚀
Proposed changes:
It is hard to check the bot's functionality after making updates and/or changes, especially when
there is a need to maintain a session for a user.
For example:
When using a CoCo component, a session identifier needs to be maintained throughout and when the user ID
doesn't change from session to session, the conversation maintains the context from the previous shell session.
Status (please check what you already did):
black
(please check Readme for instructions)