Skip to content

address model gaps#525

Open
lilyydu wants to merge 9 commits intomainfrom
lilyydu/model-gaps
Open

address model gaps#525
lilyydu wants to merge 9 commits intomainfrom
lilyydu/model-gaps

Conversation

@lilyydu
Copy link
Copy Markdown
Contributor

@lilyydu lilyydu commented Apr 14, 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

Copilot AI review requested due to automatic review settings April 14, 2026 21:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR aligns the TypeScript API models with current service behavior by adding deprecation annotations to activity-related types/properties that are no longer returned or recognized by the backend.

Changes:

  • Added @deprecated JSDoc to relatesTo across IActivity, Activity, and many derived activity interfaces, plus withRelatesTo.
  • Deprecated activity interfaces/types not recognized by the backend (IHandoffActivity, ITraceActivity, IEndOfConversationActivity, EndOfConversationCode) and the historyDisclosed property.
  • Marked several message activity fields and builder methods (e.g., speak, inputHint, importance, expiration) as deprecated, and updated Account/Attachment docs to reflect backend outputs.

Reviewed changes

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

Show a summary per file
File Description
packages/api/src/models/attachment/attachment.ts Deprecates Attachment.id as no longer returned by backend.
packages/api/src/models/account.ts Deprecates role, makes it optional, and adds type to reflect backend behavior.
packages/api/src/activities/trace.ts Deprecates ITraceActivity and relatesTo for trace activities.
packages/api/src/activities/message/message.ts Deprecates message fields and fluent setters not recognized by backend.
packages/api/src/activities/message/message-update.ts Deprecates message-update fields and fluent setters not recognized by backend.
packages/api/src/activities/invoke/task/task-submit.ts Deprecates relatesTo on task submit invoke activity.
packages/api/src/activities/invoke/task/task-fetch.ts Deprecates relatesTo on task fetch invoke activity.
packages/api/src/activities/invoke/tab/tab-submit.ts Deprecates relatesTo on tab submit invoke activity.
packages/api/src/activities/invoke/tab/tab-fetch.ts Deprecates relatesTo on tab fetch invoke activity.
packages/api/src/activities/invoke/message/submit-action.ts Deprecates relatesTo on message submit-action invoke activity.
packages/api/src/activities/invoke/message-extension/submit-action.ts Deprecates relatesTo on messaging extension submit-action invoke activity.
packages/api/src/activities/invoke/message-extension/setting.ts Deprecates relatesTo on messaging extension setting invoke activity.
packages/api/src/activities/invoke/message-extension/select-item.ts Deprecates relatesTo on messaging extension select-item invoke activity.
packages/api/src/activities/invoke/message-extension/query.ts Deprecates relatesTo on messaging extension query invoke activity.
packages/api/src/activities/invoke/message-extension/query-setting-url.ts Deprecates relatesTo on messaging extension query-setting-url invoke activity.
packages/api/src/activities/invoke/message-extension/query-link.ts Deprecates relatesTo on messaging extension query-link invoke activity.
packages/api/src/activities/invoke/message-extension/fetch-task.ts Deprecates relatesTo on messaging extension fetch-task invoke activity.
packages/api/src/activities/invoke/message-extension/card-button-clicked.ts Deprecates relatesTo on messaging extension card-button-clicked invoke activity.
packages/api/src/activities/invoke/message-extension/anon-query-link.ts Deprecates relatesTo on messaging extension anon-query-link invoke activity.
packages/api/src/activities/invoke/handoff-action.ts Deprecates relatesTo on handoff-action invoke activity.
packages/api/src/activities/invoke/file-consent.ts Deprecates relatesTo on file-consent invoke activity.
packages/api/src/activities/invoke/execute-action.ts Deprecates relatesTo on execute-action invoke activity.
packages/api/src/activities/invoke/config/config-submit.ts Deprecates relatesTo on config submit invoke activity.
packages/api/src/activities/invoke/config/config-fetch.ts Deprecates relatesTo on config fetch invoke activity.
packages/api/src/activities/handoff.ts Deprecates IHandoffActivity as not recognized by backend.
packages/api/src/activities/conversation/end-of-conversation.ts Deprecates end-of-conversation activity interface + code type.
packages/api/src/activities/conversation/conversation-update.ts Deprecates historyDisclosed as not recognized by backend.
packages/api/src/activities/activity.ts Deprecates base relatesTo and withRelatesTo.

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

Comment thread packages/api/src/activities/trace.ts Outdated
Comment thread packages/api/src/activities/handoff.ts Outdated
Comment thread packages/api/src/models/account.ts
heyitsaamir
heyitsaamir previously approved these changes Apr 15, 2026
Comment thread packages/api/src/activities/conversation/conversation-update.ts Outdated
Comment thread packages/api/src/activities/conversation/conversation-update.ts Outdated
heyitsaamir
heyitsaamir previously approved these changes Apr 15, 2026
Copy link
Copy Markdown
Collaborator

@corinagum corinagum left a comment

Choose a reason for hiding this comment

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

I don't think we can fully remove fields that are part of the official activity protocol from Activity or MessageActivity or MessageUpdateActivity themselves for compat reasons. Similar to channelData and replyToId. I totally agree with cleaning up our usage and deprecating old ABS code, but not acknowledging what's on the protocol doesn't set us up well for the future.

microsoft/teams.py#239 stems from a problem of Teams SDK models diverging from the activity protocol contarct. It applies to these as well, especially for speak and inputHint which are related to accessibility.

I think for the time being, the deprecation notes should be removed from the items on activity and message activity, message update activity and we continue the discussion on channels support internally.

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