Skip to content

Conversation

@pontemonti
Copy link
Contributor

This pull request introduces new chat history handling capabilities to the MCP Tool Registration Service. The most significant change is the implementation of methods for converting and sending chat history messages to the MCP platform, improving integration with real-time threat protection.

Chat history integration and messaging:

  • Added _convert_chat_messages_to_history, send_chat_history_messages_async, and send_chat_history_async methods to mcp_tool_registration_service.py for converting Agent Framework ChatMessage objects to the MCP platform format and sending them for real-time threat protection. These methods validate input, filter empty messages, and delegate to the core service for delivery.

Johan Broberg and others added 2 commits January 23, 2026 21:49
- CRM-003: Add turn_context validation in send_chat_history_async method
  to ensure fail-fast behavior and consistency with docstring
- CRM-004: Document empty message filtering behavior in _convert_chat_messages_to_history
  docstring and elevate log level from DEBUG to WARNING when messages are skipped

Note: CRM-001 and CRM-002 (copyright header format) are not applicable because
the existing format ("Microsoft. All rights reserved.") is required by the
pyproject.toml linter configuration (notice-rgx), while CLAUDE.md specifies a
different format. The linter-enforced format takes precedence to ensure CI passes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 24, 2026 07:04
@pontemonti pontemonti requested a review from a team as a code owner January 24, 2026 07:04
Copy link
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 pull request introduces comprehensive chat history handling capabilities to the MCP Tool Registration Service for the Agent Framework. The implementation adds three new methods for converting and sending chat history messages to the MCP platform for real-time threat protection analysis.

Changes:

  • Added chat history conversion and sending methods to the AgentFramework MCP tool registration service
  • Created comprehensive unit tests covering validation, conversion, delegation, and error handling scenarios
  • Added necessary test package structure with proper __init__.py files
  • Updated copyright header format from "Microsoft. All rights reserved." to "Microsoft Corporation. / Licensed under the MIT License."

Reviewed changes

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

Show a summary per file
File Description
libraries/microsoft-agents-a365-tooling-extensions-agentframework/microsoft_agents_a365/tooling/extensions/agentframework/services/mcp_tool_registration_service.py Adds _convert_chat_messages_to_history, send_chat_history_messages_async, and send_chat_history_async methods with proper validation, conversion logic, and delegation to core service
tests/tooling/extensions/agentframework/services/test_send_chat_history_async.py Comprehensive test suite with 17 tests covering validation, success cases, delegation patterns, and error handling
tests/tooling/extensions/agentframework/services/__init__.py Package initialization file for service tests
tests/tooling/extensions/agentframework/__init__.py Package initialization file for agentframework tests
tests/tooling/extensions/__init__.py Package initialization file for extensions tests

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.

2 participants