Draft
Conversation
Port the DevTools debugging UI from main's plugin system to core's middleware architecture. Provides real-time WebSocket activity monitoring, test message injection, and app metadata display at /devtools. Architecture: - DevToolsMiddleware (ITurnMiddleware) intercepts incoming activities + errors - DevToolsConversationClient (extends ConversationClient) intercepts outgoing - DevToolsService holds shared WebSocket state and emit helpers - Minimal API endpoints replace MVC controllers - Embedded React UI copied from main (unchanged) Usage: services.AddDevTools() + app.UseDevTools() Includes devtools-plan/ docs describing the main→core porting design. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Added Microsoft.Teams.Bot.DevTools to CoreBot and registered its services/middleware. - Enhanced MSAL configuration logic to only configure when a valid ClientId is present, returning a boolean for success and avoiding exceptions. - Fixed retrieval of AgenticIdentity in BotAuthenticationHandler. - Improved DevTools static file serving with correct content types and ensured AppId/AppName are always set in metadata. - Added a reply endpoint for bot replies in DevTools. - Updated WebSocketCollection to serialize events with runtime type and added null checks. - Minor formatting and comment improvements.
Guarantee every activity and response has a distinct ID by assigning a new GUID when missing. Improves traceability and UI handling in DevToolsConversationClient and DevToolsHostingExtensions.
DevTools middleware is now conditionally enabled based on the environment, ensuring it runs only during development and not in production.
Added Microsoft.Teams.Bot.DevTools integration for development and debugging, including conditional middleware activation in Program.cs. Refactored bot client registration in AddBotApplicationExtensions.cs to centralize config and logging, streamline MSAL setup, and ensure shared infrastructure is registered once. Updated DevToolsHostingExtensions.cs for generic UseDevTools support. Improved maintainability and authentication setup.
6 tasks
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 introduces DevTools integration for bot development, enabling enhanced debugging and event tracking in development environments. The main changes add a new
Microsoft.Teams.Bot.DevToolsproject, update sample bots to use DevTools, and refactor bot application setup to support DevTools and improve configuration handling.DevTools Integration:
Microsoft.Teams.Bot.DevToolsto the solution, including theDevToolsConversationClientdecorator that emits "sent" events for activities to DevTools UI clients. (core/core.slnx,core/src/Microsoft.Teams.Bot.DevTools/DevToolsConversationClient.cs) [1] [2]CoreBotandTeamsBot) to reference and use DevTools, including conditional middleware activation in development environments. (core/samples/CoreBot/CoreBot.csproj,core/samples/CoreBot/Program.cs,core/samples/TeamsBot/TeamsBot.csproj,core/samples/TeamsBot/Program.cs) [1] [2] [3] [4]Bot Application Setup Refactoring:
AddBotApplicationExtensions.csto centralize configuration and logger resolution, streamline MSAL setup, and improve client registration logic. This includes new helper methods and improved handling for missing authentication configuration. (core/src/Microsoft.Teams.Bot.Core/Hosting/AddBotApplicationExtensions.cs) [1] [2] [3] [4] [5] [6] [7] [8] [9]Miscellaneous Improvements:
BotConfig.Resolveto return an empty config instead of throwing whenClientIDis missing, improving startup resilience. (core/src/Microsoft.Teams.Bot.Core/Hosting/BotConfig.cs)BotAuthenticationHandler.csfor improved clarity and maintainability. (core/src/Microsoft.Teams.Bot.Core/Hosting/BotAuthenticationHandler.cs)