Fix send_chat_history to send request with empty chat history#143
Merged
pontemonti merged 2 commits intomainfrom Jan 27, 2026
Merged
Fix send_chat_history to send request with empty chat history#143pontemonti merged 2 commits intomainfrom
pontemonti merged 2 commits intomainfrom
Conversation
…ssages - Removed early return for empty chat_history_messages that was short-circuiting HTTP request - Updated docstring to document that empty lists are allowed and will still send request - Updated unit test to verify HTTP requests are made with empty chat history - Moved json import to top of test file Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix incorrect short-circuit in send_chat_history method
Fix send_chat_history to send request with empty chat history
Jan 27, 2026
pontemonti
approved these changes
Jan 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes send_chat_history so it no longer short-circuits on an empty chat_history_messages list and instead sends the required MCP platform request (with an empty chatHistory payload).
Changes:
- Removed the early return that previously skipped the HTTP request when
chat_history_messageswas empty. - Updated the
send_chat_historydocstring to document that empty lists are valid and still result in a request. - Updated unit tests to assert that an HTTP POST is made and that the serialized payload contains
chatHistory: [].
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/tooling/services/test_send_chat_history.py | Updates the empty-list test to verify an HTTP request is made and includes an empty chatHistory array. |
| libraries/microsoft-agents-a365-tooling/microsoft_agents_a365/tooling/services/mcp_tool_server_configuration_service.py | Removes empty-list short-circuit and updates documentation to reflect the new behavior. |
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_historywas short-circuiting on emptychat_history_messages, returning success without making the HTTP request. The MCP platform requires the request even with empty chat history.Changes
chatHistorypayloadBefore
After
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
il-1234567812345678123456781234567.8.tenant.api.powerplatform.com/home/REDACTED/work/Agent365-python/Agent365-python/.venv/bin/pytest pytest tests/ -v --tb=short -m not integration(dns block)il-testtenan.t.tenant.api.powerplatform.com/home/REDACTED/work/Agent365-python/Agent365-python/.venv/bin/pytest pytest tests/ -v --tb=short -m not integration(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.