-
Notifications
You must be signed in to change notification settings - Fork 9
Fix send_chat_history_messages to send empty lists to MCP platform #145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: pontemonti <[email protected]>
Co-authored-by: pontemonti <[email protected]>
There was a problem hiding this 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 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 |
c28b0e6
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.