Centralizing route handler-related annotations - #585
Merged
Rodrigo Brandão (rodrigobr-msft) merged 3 commits intoSep 14, 2026
Merged
Conversation
Copilot started reviewing on behalf of
Rodrigo Brandão (rodrigobr-msft)
September 14, 2026 20:27
View session
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues were identified.
Pull request overview
Centralizes route-handler type definitions in hosting core and updates Microsoft Teams modules to use them consistently.
Changes:
- Adds shared route decorator and state variance types.
- Updates Teams imports and route annotations.
- Exports
RouteRankfrom hosting core.
File summaries
| File | Summary |
|---|---|
libraries/microsoft-agents-hosting-msteams/microsoft_agents/hosting/msteams/type_defs.py |
Removes duplicated route types. |
libraries/microsoft-agents-hosting-msteams/microsoft_agents/hosting/msteams/teams_agent_extension.py |
Uses centralized state typing. |
libraries/microsoft-agents-hosting-msteams/microsoft_agents/hosting/msteams/team/team.py |
Updates centralized type imports. |
libraries/microsoft-agents-hosting-msteams/microsoft_agents/hosting/msteams/team/route_handlers.py |
Updates state type imports. |
libraries/microsoft-agents-hosting-msteams/microsoft_agents/hosting/msteams/task_module/task_module.py |
Updates route and state imports. |
libraries/microsoft-agents-hosting-msteams/microsoft_agents/hosting/msteams/task_module/route_handlers.py |
Updates state type imports. |
libraries/microsoft-agents-hosting-msteams/microsoft_agents/hosting/msteams/route_handlers.py |
Uses centralized state typing. |
libraries/microsoft-agents-hosting-msteams/microsoft_agents/hosting/msteams/message/route_handlers.py |
Updates state type imports. |
libraries/microsoft-agents-hosting-msteams/microsoft_agents/hosting/msteams/message/message.py |
Updates route and state imports. |
libraries/microsoft-agents-hosting-msteams/microsoft_agents/hosting/msteams/message_extension/route_handlers.py |
Updates state type imports. |
libraries/microsoft-agents-hosting-msteams/microsoft_agents/hosting/msteams/message_extension/message_extension.py |
Updates route and state imports. |
libraries/microsoft-agents-hosting-msteams/microsoft_agents/hosting/msteams/meeting/route_handlers.py |
Updates state type imports. |
libraries/microsoft-agents-hosting-msteams/microsoft_agents/hosting/msteams/meeting/meeting.py |
Updates route and state imports. |
libraries/microsoft-agents-hosting-msteams/microsoft_agents/hosting/msteams/file_consent/route_handlers.py |
Updates state type imports. |
libraries/microsoft-agents-hosting-msteams/microsoft_agents/hosting/msteams/file_consent/file_consent.py |
Updates route and state imports. |
libraries/microsoft-agents-hosting-msteams/microsoft_agents/hosting/msteams/config/route_handlers.py |
Updates state type imports. |
libraries/microsoft-agents-hosting-msteams/microsoft_agents/hosting/msteams/config/config.py |
Updates route and state imports. |
libraries/microsoft-agents-hosting-msteams/microsoft_agents/hosting/msteams/channel/route_handlers.py |
Updates state type imports. |
libraries/microsoft-agents-hosting-msteams/microsoft_agents/hosting/msteams/channel/channel.py |
Updates route and state imports. |
libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/agent_application.py |
Uses centralized route annotations. |
libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/_type_defs.py |
Defines shared route types. |
libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/__init__.py |
Exports RouteRank. |
Review details
- Files reviewed: 22/22 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot started reviewing on behalf of
Rodrigo Brandão (rodrigobr-msft)
September 14, 2026 20:34
View session
Rodrigo Brandão (rodrigobr-msft)
marked this pull request as ready for review
September 14, 2026 20:47
Rodrigo Brandão (rodrigobr-msft)
requested a review
from a team
as a code owner
September 14, 2026 20:47
Rodrigo Brandão (rodrigobr-msft)
enabled auto-merge (squash)
September 14, 2026 20:49
tracyboehrer (tracyboehrer)
approved these changes
Sep 14, 2026
Rodrigo Brandão (rodrigobr-msft)
deleted the
users/robrandao/route-annotations
branch
September 14, 2026 20:53
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.
This pull request refactors and centralizes type definitions for route handlers and decorators in the Microsoft Agents Hosting libraries. The main focus is to define
_RouteDecoratorand_StateContrain a single location (core/app/_type_defs.py) and update all references across the codebase, especially in the MS Teams integration, to import these from the new centralized module. This change improves code maintainability and reduces duplication.Type Definitions Refactoring and Centralization:
_RouteDecoratorand_StateContratype definitions tocore/app/_type_defs.py, making them the single source of truth for these types._RouteDecoratorand_StateContrafromcore/app/_type_defs.pyinstead of localtype_defsfiles. This affects files such aschannel.py,config.py,file_consent.py,meeting.py,message.py,message_extension.py,task_module.py, and their correspondingroute_handlers.pymodules. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]API Consistency and Type Hints:
message,conversation_update,message_reaction,message_update,handoff) inagent_application.pyto use the new_RouteDecoratortype, ensuring consistent and correct typing throughout the API. [1] [2] [3] [4] [5]General Imports Cleanup:
_RouteDecorator,_StateContra, andStateTfrom localtype_defsfiles, further reducing duplication and potential confusion. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]These changes collectively improve the maintainability, clarity, and correctness of the route handler type system across the hosting core and MS Teams integration code.