Skip to content

Refactoring route selection logic to improve extensability - #626

Merged
Rodrigo Brandão (rodrigobr-msft) merged 7 commits into
mainfrom
users/robrandao/app-selector-helpers
Oct 16, 2026
Merged

Rodrigo Brandão (rodrigobr-msft) merged 7 commits into
mainfrom
users/robrandao/app-selector-helpers

Conversation

@rodrigobr-msft

Copy link
Copy Markdown
Contributor

Summary

  • Add reusable route selectors for activity types, message text, invoke names, and channel IDs.
  • Add optional channel_id filtering to AgentApplication route hooks and scope direct TeamsAgentExtension routes to the Teams channel.
  • Reuse invoke-name matching in Teams configuration and message handlers.
  • Expand selector and route-filtering tests; improve the test_samples README with a sample index and corrected package guidance.

Testing

  • Core selector and route tests: 50 passed
  • Teams routing integration tests: 30 passed
  • Black formatting checks passed

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.

🟡 Changes recommended

Several documented sample workflows cannot run because their commands use incorrect invocation modes or reference missing files.

4 open findings
What changed in this PR

Refactors routing in the Microsoft 365 Agents SDK for Python to support reusable selectors and channel-specific handlers.

Changes:

  • Adds shared selectors and optional channel filtering to core route hooks.
  • Scopes direct Teams routes to Teams channels and reuses invoke-name matching.
  • Expands routing tests, sample documentation, and release notes.
File Description
tests/​hosting_msteams/​test_routing_integration.py Tests Teams-only route dispatch.
tests/​hosting_core/​app/​test_selector.py Tests reusable selector behavior.
tests/​hosting_core/​app/​test_agent_application_routes.py Tests channel-filtered route hooks.
test_samples/​README.md Adds setup guidance and a sample index.
libraries/​microsoft-agents-hosting-msteams/​microsoft_agents/​hosting/​msteams/​teams_agent_extension.py Applies Teams channel filtering.
libraries/​microsoft-agents-hosting-msteams/​microsoft_agents/​hosting/​msteams/​message/​message.py Reuses invoke-name selection.
libraries/​microsoft-agents-hosting-msteams/​microsoft_agents/​hosting/​msteams/​message_extension/​message_extension.py Reuses selectors across message-extension hooks.
libraries/​microsoft-agents-hosting-msteams/​microsoft_agents/​hosting/​msteams/​config/​config.py Reuses selection for configuration invokes.
libraries/​microsoft-agents-hosting-core/​microsoft_agents/​hosting/​core/​app/​agent_application.py Integrates selectors and channel filters.
libraries/​microsoft-agents-hosting-core/​microsoft_agents/​hosting/​core/​app/​_selector.py Introduces composable route selectors.
changelog.md Documents channel-aware routing.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test_samples/README.md Outdated
Comment thread test_samples/README.md Outdated
Comment thread test_samples/README.md Outdated
Comment thread test_samples/README.md Outdated

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.

🟢 Approval recommended

No blocking correctness issues remain; the retained feedback is a minor documentation correction.

1 open finding
4 resolved since last review

🧠 Review effort: Balanced

Comment thread test_samples/README.md
@rodrigobr-msft
Rodrigo Brandão (rodrigobr-msft) merged commit 6df66dd into main Oct 16, 2026
10 checks passed
@rodrigobr-msft
Rodrigo Brandão (rodrigobr-msft) deleted the users/robrandao/app-selector-helpers branch October 16, 2026 18:49
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.

3 participants