[Cortana] Bot leaves Cortana "thinking" before she eventually times out?
Hello everyone, first post to GitHub.
Has anyone encountered this problem?
System Information
- SDK Language: .NET
- SDK Version: 3.9
Bot Info
- Connected channels: Skype, Skype for Business, Cortana, MS Teams
Issue Description
On even the simplest or essentially non-functional intent handlers in my LUIS dialog based bot, after invoking an intent using Cortana, the client (Windows 10 Enterprise, Version 10.0.15063) will sit and wait until eventually saying that the bot service is not responding.
I am using InputHints.IgnoringInput on any activities posted back from the bot to the user.
Code Example
[LuisIntent("Root.IWantTo")]
public async Task IWantTo(IDialogContext context, LuisResult result)
{
IMessageActivity activity = context.MakeMessage();
string text = "You invoked the I Want To intent";
activity.Text = text;
activity.InputHint = InputHints.IgnoringInput;
activity.Speak = text;
await context.PostAsync(activity);
context.Wait(MessageReceived);
}
Expected Behavior
I was expecting that after my code had run, Cortana would be ready for more input, such as invoking other intents on the bot, calling other bots, or general Cortana questions. Not seeing this issue with other channels, just Cortana.
Actual Results
Cortana reads out the responses from my code as expected, but once the final bit of speech has been read, shows "thinking..." and eventually says that my bot service is not responding and that I should try again later.
Mark
Have you tried this without ignoring input? Does it work like that?
Jason,
I added the input hint in the hope that it would stop Cortana from listening, but having it as the default value (ExpectingInput) or as Ignore input gives the same outcome.
Mark
Cortana has a default 10s timeout, so if your bot doesn't respond in that time frame Cortana will throw an error.
If the transaction between the user and the bot is complete, what is Cortana waiting for next? The user initiated the conversation, my bot ran the matching intent and sent back a reply with an ignore input intent, and that code has now finished; shouldn't that be the end of the conversation?
Hi there - here is the response I received from an engineering in the Cortana team.
IgnoringInput is a signal to Cortana to ignore user input until the bot sends a subsequent message to Cortana (think ‘progress updates’). ExpectingInput will automatically turn the microphone on (which he’s already familiar with). Neither of these values will give the desired behavior.
To do what he wants, he has two options:
- Send the message with InputHint = IgnoringInput, followed immediately by an IEndOfConversationActivity sent to Cortana. This indicates to Cortana that the conversation is done entirely.
- Send the message with InputHint = AcceptingInput. This indicates to Cortana that the bot’s turn is done. The microphone doesn’t automatically turn on. However, if the user does tap the microphone button and say something, it will go back to his bot because Cortana still thinks that the user is conversing with that bot.
Sending the IEndOfConversation activity has solved the 'thinking' and subsequent time out error - many thanks for that. The 'thinking' message appears briefly and then disappears.
Cortana doesn't seem ready for input after that though, no matter how many 'hey cortana' i say to it. I have to reach for the mouse and either dismiss the Cortana popup window and then say 'hey cortana', or use the mouse to hit the microphone button with the popup still open and then start invoking the request.
I also tried using the AcceptingInput hint which also solves the 'thinking' message, but again Cortana isn't responding to voice until I use the mouse to either dismiss the cortana popup so I can say 'hey cortana', or manually initiate the conversation and then speak the command.