Code review fixes/pr 105 v3#115
Merged
pontemonti merged 9 commits intocopilot/implement-chat-history-apifrom Jan 18, 2026
Merged
Code review fixes/pr 105 v3#115pontemonti merged 9 commits intocopilot/implement-chat-history-apifrom
pontemonti merged 9 commits intocopilot/implement-chat-history-apifrom
Conversation
Convert OperationResult.success() singleton from lazy to eager initialization at module level. Python's import lock ensures thread-safe initialization, eliminating the race condition in the previous check-and-create pattern. Addresses CRM-001 from code review. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add truncated error_text (max 500 chars) to the log message when HTTP errors occur in send_chat_history. This improves debugging by showing the actual error response from the MCP platform. Addresses CRM-002 from code review. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move asyncio.TimeoutError handler before aiohttp.ClientError to ensure timeouts are caught correctly. Since aiohttp.ServerTimeoutError inherits from both exceptions, the previous order could misclassify timeouts. Addresses CRM-003 from code review. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…story Add Optional[str] type annotations for conversation_id, message_id, and user_message variables to improve code clarity and IDE support. Addresses CRM-004 from code review. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update error messages to say "cannot be empty or whitespace-only" instead of just "cannot be empty" for clearer feedback when whitespace validation fails. Addresses CRM-005 from code review. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add DEFAULT_REQUEST_TIMEOUT_SECONDS and HTTP_STATUS_OK module-level constants to replace magic values. Improves maintainability and makes configuration easier to modify. Addresses CRM-006 from code review. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…rors Move the defensive copy rationale into a prominent Note section in the docstring to make it more visible to developers. This clarifies why the property returns a copy rather than the internal list. Addresses CRM-007 from code review. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…dation Import TurnContext and use it as a spec for the mock fixture. This ensures the mock matches the actual TurnContext interface, catching potential issues if the API changes. Addresses CRM-008 from code review. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add an Example section showing how to create ChatHistoryMessage objects and call send_chat_history with proper error handling. This helps developers understand the intended usage pattern. Addresses CRM-009 from code review. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
b3e88ff
into
copilot/implement-chat-history-api
1 check passed
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.