Skip to content
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: Remove enforce auto end dialog for skill bots #4440

Merged
merged 9 commits into from
Nov 12, 2020

Conversation

ltwlf
Copy link
Contributor

@ltwlf ltwlf commented Oct 20, 2020

Description

Stops enforcing the runtime to auto end the root dialog when the bot is consumed as a skill. This is not necessary, because you can set the auto end dialog property for the root dialog in the designer. The default is true. Removing this restrictions gives the author more flexibility. There are cases where you need this control, see #4157.

Task Item

fixes #4157

@coveralls
Copy link

coveralls commented Oct 20, 2020

Coverage Status

Coverage decreased (-0.009%) to 54.723% when pulling 807b9df on ltwlf:ltwlf/skill-end-dialog into e4c4f36 on microsoft:main.

@boydc2014
Copy link
Contributor

Looks good to me, @luhan2017 @benbrown @cwhitten what do you guys think?

@luhan2017
Copy link
Contributor

luhan2017 commented Oct 26, 2020

Looks good to me, @luhan2017 @benbrown @cwhitten what do you guys think?

There are two user scenarios for the skill dialog ends:

  1. The skill dialog ends automatically when there is no more actions available in the stack.
  2. The skill dialog ends when the parent bot send it a signal.

For the 1st scenario, we need to set autoEndDialog=true when the incoming message is skill mode, but it will be problematic if the skill bot is served as a normal bot.
For the 2nd scenario, we don't need to set autoEndDialog=true, user need to have the logic in the parent bot side which is exactly what @ltwlf want.

Just removing this logic might cause issue if user want the 1st scenario.
We probably could introduce another setting autoEndDialogForSkill to distinguish the above two scenarios?

@carlosscastro who is looking at the isSkill setting, I think isSkill setting is not needed, we can add autoEndDialogForSkill to decide whether we want to enable the logic in composer runtime.

Like this.

 if (autoEndDialogForSkill && turnContext.TurnState.Get<IIdentity>(BotAdapter.BotIdentityKey) is ClaimsIdentity claimIdentity && SkillValidation.IsSkillClaim(claimIdentity.Claims))
            {
                rootDialog.AutoEndDialog = true;
            }

@ltwlf , will the autoEndDialogForSkill setting work for you?

@carlosscastro
Copy link
Member

carlosscastro commented Oct 30, 2020

Thanks @luhan2017 for putting so much thought into this, you've hit a number of very valid points and I agree that we could use a bit more consideration here.

I'd love @tomlm, @EricDahlvang, @gabog and @Stevenic to weigh in on @luhan2017's comment above. I think the setting is a detail, but we want to be very careful about what the right thing for AutoEndDialog is. This is an interesting interaction between the skills protocol and adaptive dialogs.

@ltwlf thanks for starting this discussion and providing your input! -- I know you have a real need around this so we'll keep that in focus, I just want to take a step back and make a good decision while enabling your scenario.

@EricDahlvang
Copy link
Member

We might be able to make this configurable, but i don't think we can just remove it.

Copy link
Contributor

@tomlm tomlm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit: This change is the correct change.  The runtime should NOT be hardcoding this property, and the property can be bound by the user to a setting which is bound to whether something is a skill or not.

@ltwlf
Copy link
Contributor Author

ltwlf commented Nov 3, 2020

:shipit: This change is the correct change.  The runtime should NOT be hardcoding this property, and the property can be bound by the user to a setting which is bound to whether something is a skill or not.

The author can set this via the AutoEndDialog property at the root dialog (default is true).

@luhan2017
Copy link
Contributor

Let's merge this PR, and meanwhile, I've created a follow up item in the doc side to explain how to set AutoEndDialog value based on the scenarios.
https://github.com/MicrosoftDocs/composer-docs-pr/issues/257 @zxyanliu

Copy link
Contributor

@gabog gabog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as the default is true (like I think it is) and this is explained in the docs, I'm OK with this change.

@luhan2017 luhan2017 merged commit 250bd5a into microsoft:main Nov 12, 2020
@cwhitten cwhitten mentioned this pull request Nov 13, 2020
alanlong9278 added a commit to alanlong9278/BotFramework-Composer that referenced this pull request Nov 16, 2020
* settingsPage: (22 commits)
  Refactoring function calls
  fix: remove special case for single-bot view in tree (microsoft#4803)
  fix bug
  fix UT
  code refine
  Removed other languages for now. (microsoft#4789)
  Made the default width for the property editor wider (microsoft#4788)
  pass csrf token to plugin hosts (microsoft#4787)
  Updated disability styles
  chore: rebase main onto bot-projects feature branch (microsoft#4780)
  fix: zip file can not be deleted (microsoft#4760)
  Remove enforce auto end dialog for skill bots (microsoft#4440)
  Several PVA integration improvements / bug fixes (microsoft#4776)
  Updated strings from building (microsoft#4762)
  feat: Implement pull from publish target (microsoft#4768)
  fix: Allowed 404 to fall through axios during import flow (microsoft#4770)
  increase unit tests timeout to 30 min (microsoft#4764)
  feat: Allow importing bot content from an external source (microsoft#4751)
  Localized resource files from OneLocBuild (microsoft#4730)
  force node extensions to only require commonjs (microsoft#4755)
  ...
lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
Co-authored-by: Dong Lei <donglei@microsoft.com>
Co-authored-by: Lu Han <32191031+luhan2017@users.noreply.github.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
Co-authored-by: Gabo Gilabert <gabog@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enforced autoEndDialog for skills
9 participants