Skip to content

SuggestedActionSubmitActivity for suggestedAction/submit invoke#434

Open
ShanmathiMayuramKrithivasan wants to merge 2 commits into
microsoft:mainfrom
ShanmathiMayuramKrithivasan:shmayura/suggested-actions
Open

SuggestedActionSubmitActivity for suggestedAction/submit invoke#434
ShanmathiMayuramKrithivasan wants to merge 2 commits into
microsoft:mainfrom
ShanmathiMayuramKrithivasan:shmayura/suggested-actions

Conversation

@ShanmathiMayuramKrithivasan
Copy link
Copy Markdown
Contributor

Adds support for suggestedActions/submit invoke activity - dispatched by the platform when a user clicks an Action.Submit suggested-action click.

  • New SuggestedActionSubmitInvokeActivity model and on_suggested_action_submit handler.
  • New CardActionType.SUBMIT enum value for constructing outbound suggested-action chips.
  • Marked @experimental("ExperimentalTeamsSuggestedAction") until the platform feature stabilizes.
  • New examples/suggested-actions sample app.

Copilot AI review requested due to automatic review settings May 22, 2026 12:57
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.

Adds first-class support for Teams suggestedActions/submit invoke activities (generated app handler + route config), along with API models, tests, and an end-to-end example.

Changes:

  • Introduces SuggestedActionSubmitInvokeActivity and wires it into invoke activity dispatching.
  • Adds an on_suggested_action_submit handler registration method and route selector for suggestedActions/submit.
  • Adds unit tests, fixtures, and a runnable example demonstrating Action.Submit suggested-action chips.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/apps/src/microsoft_teams/apps/routing/generated_handlers.py Adds on_suggested_action_submit handler registration API for apps.
packages/apps/src/microsoft_teams/apps/routing/activity_route_configs.py Registers route config/selector for suggestedActions/submit invoke activities.
packages/api/src/microsoft_teams/api/activities/invoke/suggested_action_submit.py Defines the new experimental invoke activity model.
packages/api/src/microsoft_teams/api/activities/invoke/init.py Exports and includes the new activity in the invoke discriminated union.
packages/api/src/microsoft_teams/api/models/card/card_action_type.py Adds CardActionType.SUBMIT for Action.Submit.
packages/api/tests/unit/test_suggested_action_submit.py Adds unit tests for model parsing/serialization + experimental warning behavior.
packages/api/tests/unit/test_fixtures.py Registers the new fixture for generic fixture-type validation.
packages/api/tests/fixtures/suggested_action_submit_invoke_activity.json Adds fixture payload for suggestedActions/submit.
examples/suggested-actions/src/main.py New example app that sends Action.Submit chips and handles suggestedActions/submit.
examples/suggested-actions/pyproject.toml Adds example packaging/deps configuration.
examples/suggested-actions/README.md Documents behavior, experimental API note, and run instructions.

Comment thread examples/suggested-actions/pyproject.toml
Comment thread packages/api/tests/unit/test_suggested_action_submit.py
output_model=None,
is_invoke=True,
),
"suggested_action.submit": ActivityConfig(
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.

should this be suggested-action.submit?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

python uses _, not hyphens (similar for other invokes like installation_update)

name: Literal["suggestedActions/submit"] = "suggestedActions/submit"
"""The name of the invoke operation."""

value: Optional[Any] = None
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.

This always needs to be present in inbound, right?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

+1, this should probably not default to None so the api throws if it's not available.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Unless you get "title" or something back too. If that's the case, then this can be None.

SIGN_IN = "signin"
CALL = "call"
INVOKE = "invoke"
SUBMIT = "Action.Submit"
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.

No doc on the new value — the .NET PR documents the equivalent field. Suggested:

SUBMIT = "Action.Submit"
"""Suggested-action chip. Clicking dispatches a `suggestedActions/submit`
invoke instead of posting a chat-visible message."""

Copy link
Copy Markdown
Collaborator

@heyitsaamir heyitsaamir left a comment

Choose a reason for hiding this comment

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

Overall looks good to me. Minor nits.

  1. Can you attach a screenshot/video of this working please?
  2. Can you give a timeline on when this is going to be available for folks to use?

name: Literal["suggestedActions/submit"] = "suggestedActions/submit"
"""The name of the invoke operation."""

value: Optional[Any] = None
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

+1, this should probably not default to None so the api throws if it's not available.

name: Literal["suggestedActions/submit"] = "suggestedActions/submit"
"""The name of the invoke operation."""

value: Optional[Any] = None
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Unless you get "title" or something back too. If that's the case, then this can be None.

name: Literal["suggestedActions/submit"] = "suggestedActions/submit"
"""The name of the invoke operation."""

value: Optional[Any] = None
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can this really be Any or does it need to be an object?

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