feat: Implement chat history API for Azure AI Foundry#142
Merged
pontemonti merged 6 commits intomainfrom Jan 28, 2026
Merged
Conversation
- Added `send_chat_history_messages` and `send_chat_history` methods to handle chat history messaging. - Introduced message conversion logic to transform ThreadMessage objects into ChatHistoryMessage format. - Implemented input validation for method parameters. - Created unit tests for input validation, message conversion, success paths, error handling, and edge cases. - Added mock classes for testing Azure AI Foundry message structures. - Established shared pytest fixtures for consistent testing setup.
Contributor
There was a problem hiding this comment.
Pull request overview
Implements an Azure AI Foundry–specific chat history API on top of the existing MCP tooling, including message conversion, validation, and comprehensive tests/documentation.
Changes:
- Added
send_chat_history_messagesandsend_chat_historytoMcpToolRegistrationServiceto convert Azure AI FoundryThreadMessageinstances intoChatHistoryMessageobjects and delegate to the core MCP tool server configuration service, with input validation and error handling. - Introduced Azure AI Foundry test fixtures and a rich test suite covering validation, message conversion, success paths, error handling, edge cases, concurrency, and tool option propagation.
- Added PRD and task documents describing the design, behavior, and implementation tasks for the Azure AI Foundry chat history API.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
libraries/microsoft-agents-a365-tooling-extensions-azureaifoundry/microsoft_agents_a365/tooling/extensions/azureaifoundry/services/mcp_tool_registration_service.py |
Adds Azure AI Foundry–specific chat history methods, including conversion from ThreadMessage to ChatHistoryMessage, orchestration of default ToolOptions, and delegation to the shared McpToolServerConfigurationService, with logging and error handling. |
tests/tooling/extensions/azureaifoundry/services/conftest.py |
Provides shared pytest fixtures for Azure AI Foundry tests (mock ThreadMessage/roles, AgentsClient, TurnContext, async iterator, and service instances with both successful and failing core services). |
tests/tooling/extensions/azureaifoundry/services/test_send_chat_history.py |
Defines unit tests for input validation, content extraction, message conversion/filtering, success paths, error propagation, edge cases (including concurrent calls and role without .value), and option propagation; one test contains an unnecessary isinstance patch now that content extraction uses duck-typing. |
tests/tooling/extensions/azureaifoundry/services/__init__.py |
Initializes the Azure AI Foundry services test package (header only). |
tests/tooling/extensions/azureaifoundry/__init__.py |
Initializes the Azure AI Foundry tests package (header only). |
docs/prd/azure-ai-foundry-chat-history-api.md |
Introduces a detailed PRD for the Azure AI Foundry chat history API (objectives, requirements, design, logging, testing, and acceptance criteria); one default-behavior row currently overstates what happens for empty histories compared to the existing core service implementation. |
docs/prd/azure-ai-foundry-chat-history-api-tasks.md |
Adds an implementation task breakdown for the feature; a few acceptance-criteria bullets (empty list handling and UUID generation for missing IDs) no longer match the agreed PRD or the implemented code. |
tests/tooling/extensions/azureaifoundry/services/test_send_chat_history.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…t_history.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
tests/tooling/extensions/azureaifoundry/services/test_send_chat_history.py
Show resolved
Hide resolved
rahuldevikar761
approved these changes
Jan 28, 2026
mrunalhirve128
approved these changes
Jan 28, 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_messagesandsend_chat_historymethods to handle chat history messaging.