Skip to content

address model gaps#336

Merged
lilyydu merged 3 commits into
mainfrom
lilyydu/noop-models
Mar 31, 2026
Merged

address model gaps#336
lilyydu merged 3 commits into
mainfrom
lilyydu/noop-models

Conversation

@lilyydu

@lilyydu lilyydu commented Mar 30, 2026

Copy link
Copy Markdown
Collaborator

model results from comparing backend codebase to our SDK, mostly removing parameters that were not being set from service. verified by examining files and/or manually testing to double confirm

Changes:

  • removed EndOfConversation activity
  • relates_to removed from all applicable activities (TraceActivity, ExecuteActionInvokeActivity, etc)
  • updated error to be Any instead of Exception b/c the deserialization would break
  • ConversationUpdate - history_disclosed removed
  • MessageBase - speak, input_hint, importance, expiration removed
  • Account - role removed, type added (applicable for mention entities)
  • Attachment - id removed

Copilot AI review requested due to automatic review settings March 30, 2026 23:12

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 Microsoft Teams SDK for Python activity/model layer to close schema gaps by removing fields/types that no longer exist (or break deserialization), and updating routing + tests to match the new model shapes.

Changes:

  • Removed EndOfConversation activity support from models and routing registration.
  • Removed relates_to from activities and removed multiple message base fields (speak, input_hint, importance, expiration) from message activities.
  • Updated Account by removing role and introducing type, plus updated several tests/usages accordingly.

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/apps/tests/test_activity_context.py Updates tests to stop using removed Account.role and activity.relates_to.
packages/apps/src/microsoft_teams/apps/routing/generated_handlers.py Removes the generated on_end_of_conversation handler API.
packages/apps/src/microsoft_teams/apps/routing/activity_route_configs.py Drops the end_of_conversation route config entry.
packages/apps/src/microsoft_teams/apps/routing/activity_context.py Removes relates_to usage in token exchange state and stops setting removed message fields.
packages/api/tests/unit/test_message_activities.py Updates many tests to stop using removed message/account fields (but still has a leftover role= usage).
packages/api/src/microsoft_teams/api/models/attachment/attachment.py Removes Attachment.id from the attachment model.
packages/api/src/microsoft_teams/api/models/activity.py Removes relates_to and the with_relates_to() builder from the base activity model.
packages/api/src/microsoft_teams/api/models/account.py Replaces Account.role with Account.type.
packages/api/src/microsoft_teams/api/models/init.py Re-exports AccountType instead of AccountRole.
packages/api/src/microsoft_teams/api/activities/trace.py Removes relates_to from trace activity base.
packages/api/src/microsoft_teams/api/activities/message/message.py Removes message-base fields and builder methods (speak, input_hint, importance, expiration).
packages/api/src/microsoft_teams/api/activities/invoke/task/task_submit.py Removes relates_to from task submit invoke activity.
packages/api/src/microsoft_teams/api/activities/invoke/task/task_fetch.py Removes relates_to from task fetch invoke activity.
packages/api/src/microsoft_teams/api/activities/invoke/tab/tab_submit.py Removes relates_to from tab submit invoke activity.
packages/api/src/microsoft_teams/api/activities/invoke/tab/tab_fetch.py Removes relates_to from tab fetch invoke activity.
packages/api/src/microsoft_teams/api/activities/invoke/message/submit_action.py Removes relates_to from message submit-action invoke activity.
packages/api/src/microsoft_teams/api/activities/invoke/message_extension/submit_action.py Removes relates_to from message extension submit-action invoke activity.
packages/api/src/microsoft_teams/api/activities/invoke/message_extension/setting.py Removes relates_to from message extension setting invoke activity.
packages/api/src/microsoft_teams/api/activities/invoke/message_extension/select_item.py Removes relates_to from message extension select-item invoke activity.
packages/api/src/microsoft_teams/api/activities/invoke/message_extension/query.py Removes relates_to from message extension query invoke activity.
packages/api/src/microsoft_teams/api/activities/invoke/message_extension/query_setting_url.py Removes relates_to from message extension query-setting-url invoke activity.
packages/api/src/microsoft_teams/api/activities/invoke/message_extension/query_link.py Removes relates_to from message extension query-link invoke activity.
packages/api/src/microsoft_teams/api/activities/invoke/message_extension/fetch_task.py Removes relates_to from message extension fetch-task invoke activity.
packages/api/src/microsoft_teams/api/activities/invoke/message_extension/card_button_clicked.py Removes relates_to from message extension card-button-clicked invoke activity.
packages/api/src/microsoft_teams/api/activities/invoke/message_extension/anon_query_link.py Removes relates_to from message extension anon-query-link invoke activity.
packages/api/src/microsoft_teams/api/activities/invoke/handoff_action.py Removes relates_to from handoff-action invoke activity.
packages/api/src/microsoft_teams/api/activities/invoke/file_consent.py Removes relates_to from file consent invoke activity.
packages/api/src/microsoft_teams/api/activities/invoke/execute_action.py Removes relates_to from execute-action invoke activity.
packages/api/src/microsoft_teams/api/activities/invoke/config/config_submit.py Removes relates_to from config submit invoke activity.
packages/api/src/microsoft_teams/api/activities/invoke/config/config_fetch.py Removes relates_to from config fetch invoke activity.
packages/api/src/microsoft_teams/api/activities/conversation/end_of_conversation.py Deletes the end-of-conversation activity models.
packages/api/src/microsoft_teams/api/activities/conversation/conversation_update.py Removes history_disclosed from conversation update activity.
packages/api/src/microsoft_teams/api/activities/conversation/init.py Removes the discriminated union and exports ConversationUpdateActivity only.
packages/api/src/microsoft_teams/api/activities/command/command_result.py Changes CommandResultValue.error typing away from Exception.
packages/api/src/microsoft_teams/api/activities/activity_params.py Removes end-of-conversation from the activity params union.
packages/api/src/microsoft_teams/api/activities/init.py Removes end-of-conversation exports.
Comments suppressed due to low confidence (1)

packages/api/tests/unit/test_message_activities.py:263

  • Account no longer defines/accepts the role field, but this test still constructs an Account with role="user", which will raise a validation/type error and fail the suite. Update the fixture to use the new type field (or omit the field entirely, consistent with the other updates in this file).

Comment thread packages/api/src/microsoft_teams/api/models/account.py
Comment thread packages/api/src/microsoft_teams/api/models/activity.py
@rido-min

Copy link
Copy Markdown
Contributor

MessageBase - speak, input_hint, importance, expiration removed

This is a breaking change, wondering if we should add the deprecation attribute before removing.

If we are not respecting DeliveryMode we should also mark it as deprecated.

@lilyydu

lilyydu commented Mar 31, 2026

Copy link
Copy Markdown
Collaborator Author

MessageBase - speak, input_hint, importance, expiration removed

This is a breaking change, wondering if we should add the deprecation attribute before removing.

If we are not respecting DeliveryMode we should also mark it as deprecated.

since we're still on public preview I think it's okay to just remove
for delivery_mode - afaik its just a pass through value for our SDK and APX honours it on their end. are we missing logic for this?

image

@lilyydu
lilyydu merged commit ef38e24 into main Mar 31, 2026
7 checks passed
@lilyydu
lilyydu deleted the lilyydu/noop-models branch March 31, 2026 21:42
lilyydu added a commit to microsoft/teams.ts that referenced this pull request May 4, 2026
equivalent to these 2 python PRs:
microsoft/teams.py#340 (not all applicable bc TS
doesnt have defined inbound/outbound interfaces)
microsoft/teams.py#336

This pull request adds deprecation warnings to several activity-related
interfaces and types to clarify that certain properties and activities
are no longer recognized or returned by the service backend. This
improves the clarity of the API and helps developers avoid using
obsolete features. Verified with APX repo and manual testing.

**Deprecation of properties and activities:**
* Marked the `relatesTo` property as deprecated in the base `IActivity`
interface, the `Activity` class, and in all derived activity interfaces
where it appears, indicating it is no longer returned by the backend.
* Added `@deprecated` annotations to the `withRelatesTo` method in the
`Activity` class for consistency.

**Deprecation of activity types not recognized by the backend:**
* Marked the `IHandoffActivity` and `ITraceActivity` interfaces as
deprecated
* Marked the `IEndOfConversationActivity` interface and
`EndOfConversationCode` type as deprecated

---------

Co-authored-by: lilydu <[email protected]>
Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants