Replace BotBuilder plugin with HTTP adapter#456
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR replaces the BotBuilder integration from a Teams “plugin” model to an HTTP server adapter model, so BotBuilder runs at the inbound HTTP boundary before Teams SDK routing/auth, reducing the need to inject privileged app internals into plugins.
Changes:
- Adds
BotBuilderAdapterand removes the priorBotBuilderPluginimplementation + its tests. - Updates the BotBuilder example to demonstrate split handling of Adaptive Card
Action.Executebetween BotBuilder and Teams SDK. - Removes now-unused plugin DI providers / dependency option types and updates example dependencies to include
microsoft-teams-cards.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Adds workspace lock entry for microsoft-teams-cards used by the BotBuilder example. |
| packages/botbuilder/tests/test_botbuilder_plugin.py | Removes tests for the deleted BotBuilderPlugin. |
| packages/botbuilder/tests/test_botbuilder_adapter.py | Adds coverage for the new BotBuilderAdapter behavior (invoke handled vs fall-through). |
| packages/botbuilder/src/microsoft_teams/botbuilder/botbuilder_plugin.py | Deletes the plugin-based integration implementation. |
| packages/botbuilder/src/microsoft_teams/botbuilder/adapter.py | Introduces the HTTP adapter that runs BotBuilder before Teams SDK handlers. |
| packages/botbuilder/src/microsoft_teams/botbuilder/init.py | Switches package exports from plugin symbols to adapter symbols. |
| packages/botbuilder/pyproject.toml | Updates package description to reflect adapter-based integration. |
| packages/apps/src/microsoft_teams/apps/plugins/metadata.py | Removes unused dependency option dataclasses from plugin metadata module. |
| packages/apps/src/microsoft_teams/apps/app.py | Removes no-longer-used container providers for plugin DI. |
| examples/botbuilder/src/main.py | Migrates example to use BotBuilderAdapter + adds adaptive card demo. |
| examples/botbuilder/src/bots/echo_bot.py | Adds BotBuilder-side handling for one adaptive card invoke action. |
| examples/botbuilder/README.md | Updates wording from “plugin” to “adapter”. |
| examples/botbuilder/pyproject.toml | Adds microsoft-teams-cards dependency and workspace source. |
lilyydu
approved these changes
Jun 9, 2026
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.
Summary
Replace the BotBuilder plugin with an HTTP adapter so BotBuilder sits at the inbound HTTP boundary instead of plugin DI.
Why
This keeps the plugin surface less privileged and avoids passing app credentials/tokens/client internals into plugins just so BotBuilder can intercept requests.
Interesting bits
BotBuilderAdapterand removesBotBuilderPlugin.Migration
Before:
After:
If you do not already create a BotBuilder
CloudAdapter,BotBuilderAdaptercan create one from explicitcredentials,MicrosoftApp*environment variables, or the sameCLIENT_ID/CLIENT_SECRET/TENANT_IDvars used byteams.apps.Reviewer tips
Start with
packages/botbuilder/src/microsoft_teams/botbuilder/adapter.py, then peek at the example to see the migration shape.Testing
uv run ruff check examples/botbuilder/src/bots/echo_bot.py packages/botbuilder/src/microsoft_teams/botbuilder/adapter.py examples/botbuilder/src/main.py packages/botbuilder/tests/test_botbuilder_adapter.pyuv run pyright packages/botbuilder/src/microsoft_teams/botbuilder/adapter.py examples/botbuilder/src/bots/echo_bot.pyuv run pytest packages/botbuilder/tests packages/apps/tests/test_card_action_routing.py