Skip to content

Conversation

@pontemonti
Copy link
Contributor

No description provided.

@pontemonti pontemonti requested a review from a team as a code owner January 22, 2026 05:17
Copilot AI review requested due to automatic review settings January 22, 2026 05:17
Copy link
Contributor

Copilot AI left a 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 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 method
  • send_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

@pontemonti pontemonti enabled auto-merge (squash) January 23, 2026 23:03
- 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.
Copilot AI review requested due to automatic review settings January 25, 2026 03:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Johan Broberg and others added 2 commits January 24, 2026 19:59
…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>
Copilot AI review requested due to automatic review settings January 25, 2026 04:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings January 25, 2026 04:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.

…tooling/extensions/__init__.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 25, 2026 04:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 25, 2026 04:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants