feat/bug: add custom feedback form & fix pydantic valid error on MessageUpdateActivity#349
Merged
feat/bug: add custom feedback form & fix pydantic valid error on MessageUpdateActivity#349
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds SDK support for Teams “custom feedback form” flows (message/fetchTask) and fixes a Pydantic validation failure when messageUpdate activities omit text (e.g., attachment-only updates).
Changes:
- Add
MessageFetchTaskInvokeActivity+ apps routing hooks (on_message_fetch_task) for custom feedback task modules. - Introduce
ChannelData.feedback_loop/FeedbackLoopand updateActivity.add_feedback()to support"default"vs"custom". - Default
MessageUpdateActivity.textto""and add unit tests to prevent regressions.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/apps/src/microsoft_teams/apps/routing/generated_handlers.py | Adds generated handler registration method for message.fetch-task. |
| packages/apps/src/microsoft_teams/apps/routing/activity_route_configs.py | Registers new route config for message/fetchTask invokes returning a task module response. |
| packages/api/tests/unit/test_message_activities.py | Adds tests ensuring MessageUpdateActivity.text defaults to empty string and inbound parsing succeeds without text. |
| packages/api/tests/unit/test_activity.py | Updates feedback tests for new feedback_loop model and adds custom-mode assertion. |
| packages/api/src/microsoft_teams/api/models/channel_data/feedback_loop.py | New FeedbackLoop model representing feedback configuration. |
| packages/api/src/microsoft_teams/api/models/channel_data/channel_data.py | Adds feedback_loop field and normalization logic for legacy feedback_loop_enabled. |
| packages/api/src/microsoft_teams/api/models/channel_data/init.py | Exports FeedbackLoop from the channel_data package. |
| packages/api/src/microsoft_teams/api/models/activity.py | Extends add_feedback() to support "default" vs "custom" via feedback_loop. |
| packages/api/src/microsoft_teams/api/activities/message/message_update.py | Defaults MessageUpdateActivity.text to "" to avoid validation errors. |
| packages/api/src/microsoft_teams/api/activities/invoke/message/fetch_task.py | New invoke activity model for message/fetchTask. |
| packages/api/src/microsoft_teams/api/activities/invoke/message/init.py | Re-exports newly added message invoke models. |
| packages/api/src/microsoft_teams/api/activities/invoke/init.py | Adds MessageFetchTaskInvokeActivity to the invoke tagged union. |
packages/api/src/microsoft_teams/api/models/channel_data/channel_data.py
Outdated
Show resolved
Hide resolved
packages/api/src/microsoft_teams/api/models/channel_data/feedback_loop.py
Outdated
Show resolved
Hide resolved
packages/apps/src/microsoft_teams/apps/routing/activity_route_configs.py
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
corinagum
reviewed
Apr 3, 2026
Contributor
corinagum
approved these changes
Apr 3, 2026
Contributor
corinagum
left a comment
There was a problem hiding this comment.
lgtm!
Do you know if there's a plan to deprecate feedbackLoopEnabled? Do we want to plan to deprecate it for simplicity?
Collaborator
Author
heyitsaamir
approved these changes
Apr 3, 2026
Collaborator
heyitsaamir
left a comment
There was a problem hiding this comment.
Can we show an example?
packages/api/src/microsoft_teams/api/models/channel_data/channel_data.py
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


resolves: #326 and #347
textinMessageUpdateActivity(otherwise throws pydantic error)ChannelData.feedback_loop).Custom Feedback Context:
Learn Doc
enable_feedback_loopwhich only enables the default feedback formfeedback_loopthat can either be default or custom.enable_feedback_loopintofeedback_loop. wheneverenable_feedback_loopis set to True, it'll setfeedback_loopto default and itself back toNone.Example Usage: