Fix send_chat_history_messages to send empty lists to MCP platform#145
Merged
pontemonti merged 4 commits intomainfrom Jan 27, 2026
Merged
Fix send_chat_history_messages to send empty lists to MCP platform#145pontemonti merged 4 commits intomainfrom
pontemonti merged 4 commits intomainfrom
Conversation
Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com>
Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix send chat history messages to handle empty lists
Fix send_chat_history_messages to send empty lists to MCP platform
Jan 27, 2026
pontemonti
approved these changes
Jan 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where send_chat_history_messages would return early when chat messages or history messages were empty, preventing the user message from being registered in the MCP platform for real-time threat protection.
Changes:
- Removed early returns in core service and extensions when chat history is empty
- Updated docstrings to document that empty lists are valid inputs
- Updated tests to verify that API calls are made even with empty lists
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
libraries/microsoft-agents-a365-tooling/microsoft_agents_a365/tooling/services/mcp_tool_server_configuration_service.py |
Removed early return for empty chat_history_messages and updated docstring to clarify empty lists are allowed |
libraries/microsoft-agents-a365-tooling-extensions-openai/microsoft_agents_a365/tooling/extensions/openai/mcp_tool_registration_service.py |
Removed early returns for empty input and post-conversion filtered messages, updated docstrings |
libraries/microsoft-agents-a365-tooling-extensions-agentframework/microsoft_agents_a365/tooling/extensions/agentframework/services/mcp_tool_registration_service.py |
Removed early returns for empty input and post-conversion filtered messages, updated docstrings |
tests/tooling/services/test_send_chat_history.py |
Updated test to verify core service makes HTTP request with empty list |
tests/tooling/extensions/openai/test_send_chat_history.py |
Updated test to verify core service is called with empty list |
tests/tooling/extensions/agentframework/services/test_send_chat_history.py |
Updated tests to verify core service is called with empty lists in both empty input and all-filtered scenarios |
tmlsousa
previously approved these changes
Jan 27, 2026
rahuldevikar761
previously approved these changes
Jan 27, 2026
c28b0e6
tmlsousa
approved these changes
Jan 27, 2026
rahuldevikar761
approved these changes
Jan 27, 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.
send_chat_history_messageswas returning early whenchat_messagesorhistory_messageswere empty, skipping the API call entirely. This prevented the user message (turn_context.activity.text) from being registered in the MCP platform for real-time threat protection.Changes
mcp_tool_server_configuration_service.py): Removed early return for emptychat_history_messagesBehavior Change
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.