Skip to content

Initial implementation of API to send chat history to MCP platform.#148

Merged
pontemonti merged 33 commits intomainfrom
users/johanb/RealTimeThreatProtection
Jan 6, 2026
Merged

Initial implementation of API to send chat history to MCP platform.#148
pontemonti merged 33 commits intomainfrom
users/johanb/RealTimeThreatProtection

Conversation

@pontemonti
Copy link
Copy Markdown
Contributor

No description provided.

@pontemonti pontemonti marked this pull request as ready for review December 27, 2025 04:53
@pontemonti pontemonti requested a review from a team as a code owner December 27, 2025 04:53
Copilot AI review requested due to automatic review settings December 27, 2025 04:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements an API for sending chat history to an MCP (Model Context Protocol) platform endpoint for real-time threat protection analysis. The implementation adds new data models, service methods, and utility functions to support this feature.

Key changes:

  • Adds SendChatHistoryAsync methods to IMcpToolServerConfigurationService for sending chat history to the MCP platform
  • Introduces new models (ChatMessageRequest, ChatHistoryMessage) to represent chat history data
  • Creates utility method GetChatHistoryEndpoint for constructing the chat history endpoint URL
  • Adds singleton Instance property to Agent365SdkUserAgentConfiguration and uses new keyword in derived classes to provide type-specific instances
  • Implements GetDefaultHttpClient utility method in Runtime to centralize HttpClient creation with standard configuration

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/Tooling/Extensions/SemanticKernel/Agent365SemanticKernelSdkUserAgentConfiguration.cs Adds new keyword to Instance property to hide base class member and return derived type
src/Tooling/Extensions/AzureAIFoundry/Agent365AzureAIFoundrySdkUserAgentConfiguration.cs Adds new keyword to Instance property to hide base class member and return derived type
src/Tooling/Extensions/AgentFramework/Agent365AgentFrameworkSdkUserAgentConfiguration.cs Adds new keyword to Instance property to hide base class member and return derived type
src/Tooling/Core/Utils/Utility.cs Adds GetChatHistoryEndpoint method to construct endpoint URL for chat history API
src/Tooling/Core/Services/McpToolServerConfigurationService.cs Implements SendChatHistoryAsync methods to POST chat history to MCP platform; refactors GetMCPServerFromToolingGatewayAsync to use new GetDefaultHttpClient utility
src/Tooling/Core/Services/IMcpToolServerConfigurationService.cs Adds interface definitions for SendChatHistoryAsync methods (with and without ToolOptions)
src/Tooling/Core/Models/ChatMessageRequest.cs New model representing the request payload for sending chat messages to threat protection endpoint
src/Tooling/Core/Models/ChatHistoryMessage.cs New model representing individual messages in chat history with id, role, content, and timestamp
src/Runtime/Core/Utility.cs Adds GetDefaultHttpClient utility method for creating HttpClient instances with standard timeout and user agent configuration
src/Runtime/Core/Agent365SdkUserAgentConfiguration.cs Adds static Instance property to provide singleton access to default configuration
src/Tests/Runtime.Tests/Agent365SdkUserAgentConfigurationTests.cs Adds tests for Instance singleton property behavior and validation
src/Tests/Microsoft.Agents.A365.Tooling.Tests/Utils/UtilityTests.cs New test file with comprehensive tests for GetChatHistoryEndpoint and other utility methods
src/Tests/Microsoft.Agents.A365.Tooling.Tests/Services/McpToolServerConfigurationServiceTests.cs New test file with tests for SendChatHistoryAsync parameter validation
src/Tests/Microsoft.Agents.A365.Tooling.Tests/Models/ChatMessageRequestTests.cs New test file with tests for ChatMessageRequest serialization and constructor behavior
src/Tests/Microsoft.Agents.A365.Tooling.Tests/Models/ChatHistoryMessageTests.cs New test file with tests for ChatHistoryMessage serialization and property handling
src/Tests/Microsoft.Agents.A365.Tooling.Tests/Microsoft.Agents.A365.Tooling.Tests.csproj New test project file for Tooling component tests
src/Microsoft.Agents.A365.Sdk.sln Adds new test project to solution file

Comment thread src/Tooling/Core/Services/McpToolServerConfigurationService.cs
Comment thread src/Tooling/Core/Utils/Utility.cs Outdated
Comment thread src/Tooling/Core/Services/McpToolServerConfigurationService.cs
Comment thread src/Tooling/Core/Services/McpToolServerConfigurationService.cs
Comment thread src/Tooling/Core/Models/ChatMessageRequest.cs Outdated
Comment thread src/Tooling/Core/Models/ChatHistoryMessage.cs
Comment thread src/Tooling/Core/Utils/Utility.cs
Comment thread src/Tooling/Core/Services/McpToolServerConfigurationService.cs
Comment thread src/Tooling/Core/Models/ChatHistoryMessage.cs Outdated
Comment thread src/Tooling/Core/Services/McpToolServerConfigurationService.cs Outdated
Copy link
Copy Markdown
Collaborator

@rahuldevikar761 rahuldevikar761 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's not urgent, I want to discuss this offline.

tmlsousa
tmlsousa previously approved these changes Dec 29, 2025
Copilot AI review requested due to automatic review settings December 31, 2025 04:59
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 12 comments.

Comment thread src/Tooling/Core/Services/IMcpToolServerConfigurationService.cs Outdated
Comment thread src/Tooling/Core/Services/McpToolServerConfigurationService.cs Outdated
Comment thread src/Tests/Microsoft.Agents.A365.Tooling.Tests/Models/ChatHistoryMessageTests.cs Outdated
Comment thread src/Tooling/Core/Utils/Utility.cs Outdated
Comment thread src/Tooling/Core/Services/McpToolServerConfigurationService.cs Outdated
Comment thread src/Tooling/Core/Services/McpToolServerConfigurationService.cs
Comment thread src/Runtime/Core/Utility.cs Outdated
Comment thread src/Tooling/Core/Utils/Utility.cs
Comment thread src/Tooling/Core/Services/McpToolServerConfigurationService.cs Outdated
@pontemonti
Copy link
Copy Markdown
Contributor Author

If it's not urgent, I want to discuss this offline.

We'll want to get this in ASAP so that we can proceed with the other implementations - there are teams waiting for this.

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 31, 2025

@pontemonti I've opened a new pull request, #150, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings December 31, 2025 05:11
…ryMessageTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated no new comments.

@pontemonti pontemonti dismissed rahuldevikar761’s stale review December 31, 2025 05:15

Trying to get this in ASAP, we can discuss any follow-ups later.

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 31, 2025

@pontemonti I've opened a new pull request, #151, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Copilot AI and others added 2 commits December 31, 2025 08:54
* Initial plan

* Wrap HttpResponseMessage in using statement for proper disposal

Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com>
…164)

* Initial plan

* Fix HttpResponseMessage disposal issues by using lambda factory pattern

Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com>
Copilot AI review requested due to automatic review settings December 31, 2025 16:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.

…ServerConfigurationServiceTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings December 31, 2025 17:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 31, 2025

@pontemonti I've opened a new pull request, #165, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits December 31, 2025 09:53
)

* Initial plan

* Fix HttpResponseMessage disposal race condition in test

Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com>
Copilot AI review requested due to automatic review settings December 31, 2025 22:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.

Comment thread src/Tooling/Core/Services/McpToolServerConfigurationService.cs
Comment thread src/Tooling/Core/Services/McpToolServerConfigurationService.cs
@pontemonti pontemonti enabled auto-merge (squash) January 6, 2026 19:02
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.

7 participants