Updated quoted replies & new quotes features#321
Open
Conversation
c96f0af to
6d76792
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates how “quoted replies” are represented and built in the Microsoft Teams SDK for Python by moving from reply_to_id/blockquote HTML to a dedicated quotedReply entity plus a <quoted messageId="..."/> placeholder, and exposes new helper APIs for creating and reading quoted replies.
Changes:
- Add
QuotedReplyData/QuotedReplyEntitymodels and registerQuotedReplyEntityin the entity union. - Update outbound reply building (
ActivityContext.reply()/quote_reply(),MessageActivityInput.add_quoted_reply()) and inbound parsing (MessageActivity.get_quoted_messages()). - Add unit tests and a new
examples/quoted-repliessample app; removewith_reply_to_id().
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Adds the new quoted-replies example as a workspace member/package entry. |
| packages/apps/tests/test_quoted_reply.py | New tests validating quoted reply stamping/placeholder behavior. |
| packages/apps/tests/test_activity_context.py | Updates reply tests to assert quotedReply entity + placeholder; removes one targeted-send inference test. |
| packages/apps/src/microsoft_teams/apps/routing/activity_context.py | Implements quotedReply stamping in reply() and adds quote_reply(). |
| packages/api/tests/unit/test_quoted_reply_entity.py | Tests serialization/deserialization for the new quoted reply models. |
| packages/api/tests/unit/test_quoted_replies_property.py | Tests inbound filtering (get_quoted_messages) and outbound builder (add_quoted_reply). |
| packages/api/tests/unit/test_activity.py | Removes usage/assertion for the deleted with_reply_to_id() builder. |
| packages/api/src/microsoft_teams/api/models/entity/quoted_reply_entity.py | Introduces QuotedReplyData and QuotedReplyEntity models (experimental). |
| packages/api/src/microsoft_teams/api/models/entity/entity.py | Registers QuotedReplyEntity in the Entity union. |
| packages/api/src/microsoft_teams/api/models/entity/init.py | Exports QuotedReplyData and QuotedReplyEntity. |
| packages/api/src/microsoft_teams/api/models/activity.py | Removes with_reply_to_id() builder. |
| packages/api/src/microsoft_teams/api/activities/message/message.py | Adds get_quoted_messages() and add_quoted_reply() on message activities. |
| examples/quoted-replies/src/main.py | New example bot demonstrating all quoted-reply APIs. |
| examples/quoted-replies/pyproject.toml | Adds project metadata/deps for the new example. |
| examples/quoted-replies/README.md | Adds run instructions and command list for the example. |
| .coverage | Adds a coverage database artifact to the repo (should not be committed). |
packages/apps/src/microsoft_teams/apps/routing/activity_context.py
Outdated
Show resolved
Hide resolved
packages/apps/src/microsoft_teams/apps/routing/activity_context.py
Outdated
Show resolved
Hide resolved
packages/apps/src/microsoft_teams/apps/routing/activity_context.py
Outdated
Show resolved
Hide resolved
added 9 commits
March 24, 2026 16:09
b4d7777 to
a7a0366
Compare
lilyydu
reviewed
Mar 25, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
a2f12d3 to
27f5d89
Compare
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.
with_reply_to_id()QuotedReplyEntityPydantic model with nestedQuotedReplyData(message_idrequired,sender_id/sender_name/preview/time/is_reply_deleted/validated_message_referenceoptional); register in Entity unionget_quoted_messages()onMessageActivityto read inbound quoted reply entitiesadd_quoted_reply(message_id, response?)builder onMessageActivityInputreply()to stampQuotedReplyEntity + <quoted messageId="..."/>placeholder instead of blockquote HTML; removereply_to_idassignmentquote_reply()onActivityContext@experimental