Skip to content

Fix MessageExtensionBot create action flow - #626

Closed
heyitsaamir wants to merge 3 commits into
mainfrom
heyitsaamir/message-extension-sample-fixes
Closed

Fix MessageExtensionBot create action flow#626
heyitsaamir wants to merge 3 commits into
mainfrom
heyitsaamir/message-extension-sample-fixes

Conversation

@heyitsaamir

Copy link
Copy Markdown
Collaborator

Summary

This tightens the MessageExtensionBot sample around the supported message extension create flow. The create dialog now produces a composed adaptive card result on submit instead of entering the bot message preview path, which avoids the client-side preview validation/rendering issues we hit while testing.

The README also gives a copy-pastable Teams CLI manifest update command so a newly created Teams app can be wired up for the sample commands and example.com link unfurling without manually editing a manifest package.

Decisions

  • Keep create as a message extension result. Multi-step task module dialogs work on the regular task/fetch / task/submit surface, but the message extension submit surface is better represented by returning a composed result, matching the Python message extension sample.
  • Use example.com for unfurling. The unfurl domain is the URL pasted by the user, not the bot endpoint host, so the manifest command keeps *.example.com aligned with the sample instructions.

Update the MessageExtensionBot sample so the create action submit returns a composed message extension result instead of a bot message preview, matching the supported create dialog flow. Also document the Teams CLI manifest update needed to enable the message extension commands and link unfurling.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 82314bfe-bb27-4f78-95d4-a20c437ef3b1
Copilot AI review requested due to automatic review settings July 29, 2026 00:40
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the MessageExtensionBot sample to align the “create” action with the supported Teams message extension create/submit flow by returning a composed result on submit (instead of entering the bot message preview path), and updates the README with a Teams CLI command to patch a Teams app manifest.

Changes:

  • Update the submit-action handler to return a MessageExtensionResponseTypes.Result with an adaptive card attachment.
  • Add a copy/pastable teams app manifest update --set-json ... command to wire compose extension commands + link unfurling domains.
Show a summary per file
File Description
core/samples/MessageExtensionBot/README.md Adds Teams CLI instructions to update a Teams app manifest for the sample’s commands and link unfurling.
core/samples/MessageExtensionBot/Program.cs Changes the create submit path to return a compose extension “result” with an adaptive card attachment (no bot message preview).

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Low

3. Add the message extension manifest entries to your Teams app. Replace `<TEAMS_APP_ID>` with your Teams app ID. This command works in Bash and PowerShell; the Teams CLI will prompt for the app to update:

~~~bash
teams app manifest update --set-json 'composeExtensions=[{"botId":"<TEAMS_APP_ID>","commands":[{"id":"searchQuery","type":"query","title":"searchQuery","description":"Enter search text","initialRun":true,"fetchTask":false,"context":["commandBox","compose","message"],"parameters":[{"name":"searchText","title":"searchText","description":"Enter search text","inputType":"text"}]},{"id":"createAction","type":"action","title":"createAction","description":"Create a new item","initialRun":true,"fetchTask":true,"context":["commandBox","compose","message"],"parameters":[{"name":"createAction","title":"createAction","description":"Create a new item","inputType":"text"}]}],"canUpdateConfiguration":true,"messageHandlers":[{"type":"link","value":{"domains":["*.example.com"],"supportsAnonymizedPayloads":true}}]}]'

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

actually instead, update hte cli command to unfurl microsoft.com and example.com, like the rest of the readme suggests.

Comment thread core/samples/MessageExtensionBot/README.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread core/samples/MessageExtensionBot/Program.cs
@MehakBindra

Copy link
Copy Markdown
Member

The correct fix for this is in - #630

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants