Replace BotBuilder plugin with HTTP adapter#610
Merged
Conversation
heyitsaamir
force-pushed
the
botbuilder-http-server-adapter
branch
7 times, most recently
from
June 8, 2026 05:06
c66232a to
69bc187
Compare
heyitsaamir
marked this pull request as ready for review
June 8, 2026 21:30
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the @microsoft/teams.botbuilder integration from an App plugin into an IHttpServerAdapter wrapper (BotBuilderAdapter), aiming to keep BotBuilder at the HTTP boundary and simplify/lock down the plugin DI surface in @microsoft/teams.apps.
Changes:
- Introduces
BotBuilderAdapter(implementsIHttpServerAdapter) and replacesBotBuilderPlugin. - Removes now-unused plugin DI registrations/types (e.g., id/name/manifest/credentials/tokens, raw client injection).
- Updates the botbuilder example and adds new adapter-focused tests.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/dev/src/plugin.ts | Removes optional DI dependencies (id/name) and stops emitting id in devtools metadata. |
| packages/botbuilder/src/plugin.ts | Removes the old BotBuilder plugin implementation. |
| packages/botbuilder/src/plugin.spec.ts | Removes plugin tests in favor of adapter tests. |
| packages/botbuilder/src/index.ts | Re-exports the new adapter entrypoint instead of the plugin. |
| packages/botbuilder/src/adapter.ts | Adds the new HTTP adapter wrapper that runs BotBuilder before forwarding to the Teams handler. |
| packages/botbuilder/src/adapter.spec.ts | Adds unit tests for adapter behavior (invoke handling, env-based adapter construction, fallthrough). |
| packages/apps/src/types/plugin/decorators/dependency.ts | Removes special-cased DI option types for deprecated DI entries. |
| packages/apps/src/app.ts | Stops registering removed DI entries (id/name/manifest/credentials/botToken + raw client). |
| package-lock.json | Updates lockfile to include @microsoft/teams.cards (used by the updated example). |
| examples/botbuilder/src/index.ts | Migrates example from plugin usage to httpServerAdapter: new BotBuilderAdapter(...) and adds invoke-handling demo. |
| examples/botbuilder/package.json | Adds @microsoft/teams.cards dependency for the updated example. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
heyitsaamir
force-pushed
the
botbuilder-http-server-adapter
branch
from
June 8, 2026 23:17
69bc187 to
92f1340
Compare
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
corinagum
reviewed
Jun 11, 2026
corinagum
reviewed
Jun 11, 2026
corinagum
reviewed
Jun 11, 2026
lilyydu
reviewed
Jun 11, 2026
lilyydu
reviewed
Jun 11, 2026
…r-adapter # Conflicts: # packages/apps/src/app.ts # packages/apps/src/types/plugin/decorators/dependency.ts # packages/botbuilder/src/plugin.ts
corinagum
approved these changes
Jun 15, 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.
Make BotBuilder an HTTP server adapter instead of an App plugin.
Why: BotBuilder participates at the inbound HTTP layer. Modeling it as an adapter keeps App plugin DI cleaner and lets Core/App treat BotBuilder as host integration rather than a privileged plugin that reaches back into the server. This also allows us to clean up our plugin DI that is unnecessarily fairly privileged (eg. why do plugins get access to creds, tokens etc). Doing this allows us to then move toward a more layered architecture (similar to .net), where the "core" layer will be the only "more" priviledged layer (with creds, tokens etc), instead of this information being passed around everywhere.
Migration path:
If you already construct a BotBuilder CloudAdapter:
If no cloudAdapter is supplied, BotBuilderAdapter constructs one from explicit credentials, MicrosoftApp* environment variables, or the same CLIENT_ID / CLIENT_SECRET / TENANT_ID env vars used by teams.apps.
Interesting bits:
Reviewer tips:
Testing: