Implement API to send chat history for OpenAI orchestrator#127
Merged
pontemonti merged 13 commits intomainfrom Jan 26, 2026
Merged
Implement API to send chat history for OpenAI orchestrator#127pontemonti merged 13 commits intomainfrom
pontemonti merged 13 commits intomainfrom
Conversation
added 4 commits
January 21, 2026 15:28
…` and update PRD to reflect new method naming conventions and functionality.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements two new async APIs for the OpenAI orchestrator extension to send chat history to the MCP platform for real-time threat protection:
send_chat_history_async()- Extracts messages from an OpenAI Session and delegates to the message-based methodsend_chat_history_messages_async()- Accepts a list of OpenAI TResponseInputItem messages directly and converts them to ChatHistoryMessage format
Changes:
- Added two new public async methods with comprehensive message conversion logic
- Implemented private helper methods for role, content, ID, and timestamp extraction
- Created 38+ comprehensive unit and integration tests organized into validation, conversion, success path, error handling, and integration test suites
- Added PRD and task breakdown documentation
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
mcp_tool_registration_service.py |
Added two public methods and five private conversion helpers with proper error handling and delegation |
__init__.py (openai extension) |
Updated exports and documentation to include type hint guidance |
__init__.py (tooling extensions) |
Added namespace package configuration for editable installs |
pyproject.toml |
Added B903 exception for tests to allow bare except Exception |
test_send_chat_history_async.py |
27 unit tests for input validation, success paths, and error handling |
test_message_conversion.py |
32 unit tests for message conversion logic with comprehensive edge cases |
test_integration.py |
6 integration tests for end-to-end flows with mocked HTTP |
conftest.py |
Shared pytest fixtures with mock OpenAI types and TurnContext variations |
openai-send-chat-history-api.md |
Comprehensive PRD with requirements, API design, and testing strategy |
openai-send-chat-history-api-tasks.md |
Detailed task breakdown with effort estimates and dependencies |
CLAUDE.md |
Updated with type hints guidance emphasizing never using Any |
libraries/microsoft-agents-a365-tooling/microsoft_agents_a365/tooling/extensions/__init__.py
Show resolved
Hide resolved
JesuTerraz
reviewed
Jan 23, 2026
- Removed unnecessary async suffix from send_chat_history methods for consistency. - Updated docstrings and comments for clarity. - Introduced end-to-end tests for send_chat_history methods with mocked HTTP responses. - Added unit tests for input validation, success paths, error handling, and orchestrator name handling. - Ensured thread safety and isolation for concurrent calls to send_chat_history methods. - Improved overall test coverage and reliability of the service.
libraries/microsoft-agents-a365-tooling/microsoft_agents_a365/tooling/extensions/__init__.py
Show resolved
Hide resolved
…quality - CRM-003: Add return type annotation to add_tool_servers_to_agent - CRM-004: Add type annotations to _cleanup_servers and cleanup_all_servers - CRM-006: Fix conversion error test to actually test error handling - CRM-007: Update implicit boolean check to explicit None check - CRM-008: Remove redundant local import of Agent - CRM-010: Use bare raise instead of raise e - CRM-011: Rename test to match behavior (skips_message not uses_empty_string) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…tooling/extensions/__init__.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
...ions-openai/microsoft_agents_a365/tooling/extensions/openai/mcp_tool_registration_service.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
rahuldevikar761
approved these changes
Jan 26, 2026
mrunalhirve128
approved these changes
Jan 26, 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.
No description provided.