Open-Assistant
Open-Assistant copied to clipboard
Stop users from starting more than one task at a time
The bot now keeps a set of user ID's for everyone currently doing a task. This gets removed after a user times out or doesn't want to do another task.
I don't have a good overview over what the code looks like, but could we store a map user -> task, so that at least internally we have an idea which task the user is working on? we could then log this internally when we yell at the user, and when there's a problem and a user says "hey it tells me I already have a task, but I don't", we can go and debug.
I don't have a good overview over what the code looks like, but could we store a map user -> task, so that at least internally we have an idea which task the user is working on? we could then log this internally when we yell at the user, and when there's a problem and a user says "hey it tells me I already have a task, but I don't", we can go and debug.
We could use a weakref map from user id to task. Should we give the user an option to cancel their old task?