SuggestedActionSubmitActivity for suggestedAction/submit invoke#434
Conversation
There was a problem hiding this comment.
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
SuggestedActionSubmitInvokeActivityand wires it into invoke activity dispatching. - Adds an
on_suggested_action_submithandler registration method and route selector forsuggestedActions/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. |
| output_model=None, | ||
| is_invoke=True, | ||
| ), | ||
| "suggested_action.submit": ActivityConfig( |
There was a problem hiding this comment.
should this be suggested-action.submit?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
This always needs to be present in inbound, right?
There was a problem hiding this comment.
+1, this should probably not default to None so the api throws if it's not available.
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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."""
heyitsaamir
left a comment
There was a problem hiding this comment.
Overall looks good to me. Minor nits.
- Can you attach a screenshot/video of this working please?
- 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 |
There was a problem hiding this comment.
+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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Can this really be Any or does it need to be an object?
Adds support for
suggestedActions/submitinvoke activity - dispatched by the platform when a user clicks anAction.Submitsuggested-action click.SuggestedActionSubmitInvokeActivitymodel andon_suggested_action_submithandler.CardActionType.SUBMITenum value for constructing outbound suggested-action chips.@experimental("ExperimentalTeamsSuggestedAction")until the platform feature stabilizes.examples/suggested-actionssample app.