Skip to content

Comments

Improve citation and reaction logic#452

Merged
siddharthh98 merged 4 commits intomainfrom
users/sigaur/fix-citation-and-reaction
Feb 20, 2026
Merged

Improve citation and reaction logic#452
siddharthh98 merged 4 commits intomainfrom
users/sigaur/fix-citation-and-reaction

Conversation

@siddharthh98
Copy link
Contributor

  • Add GenesysHandoff.sln solution file for project structure.
  • Refactor GenesysHandoffAgent to delegate Copilot client creation, activity response processing, and conversation state management to new service classes.
  • Introduce ActivityResponseProcessor, CitationEntityProcessor, CitationUrlCleaner, ConversationStateManager, and CopilotClientFactory.
  • Move citation and entity processing logic out of the agent for better separation of concerns.
  • Improve logging, documentation, and dependency injection for maintainability and testability.
  • Remove redundant code and clarify XML docs.

- Add GenesysHandoff.sln solution file for project structure.
- Refactor GenesysHandoffAgent to delegate Copilot client creation, activity response processing, and conversation state management to new service classes.
- Introduce ActivityResponseProcessor, CitationEntityProcessor, CitationUrlCleaner, ConversationStateManager, and CopilotClientFactory.
- Move citation and entity processing logic out of the agent for better separation of concerns.
- Improve logging, documentation, and dependency injection for maintainability and testability.
- Remove redundant code and clarify XML docs.
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 refactors the GenesysHandoffAgent to improve separation of concerns by extracting citation processing, activity response handling, conversation state management, and Copilot client creation into dedicated service classes. The refactoring aims to improve code maintainability, testability, and documentation.

Changes:

  • Extracted Copilot client creation, activity processing, citation handling, and state management into dedicated service classes
  • Improved XML documentation and logging throughout the codebase
  • Added GenesysHandoff.sln solution file for project structure
  • Changed from AskQuestionAsync to SendActivityAsync API for CopilotClient interaction

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 17 comments.

Show a summary per file
File Description
GenesysHandoffAgent.cs Refactored to delegate responsibilities to new service classes; broke down HandleAllActivities into smaller methods
Services/CopilotClientFactory.cs New factory class for creating configured CopilotClient instances
Services/ConversationStateManager.cs New class to manage conversation state properties
Services/CitationUrlCleaner.cs New utility class for removing citation URLs from text
Services/CitationEntityProcessor.cs New class to process and fix citation entities for Teams rendering
Services/ActivityResponseProcessor.cs New class to process Copilot Studio activities and prepare responses
GenesysHandoff.sln New Visual Studio solution file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Refactored GenesysHandoffAgent to use constructor injection for CopilotClientFactory, ActivityResponseProcessor, and ConversationStateManager; registered these as singletons in Program.cs.
- Enhanced CopilotClientFactory with required ILogger, robust error handling, and improved configuration validation and logging.
- Improved ActivityResponseProcessor: clarified which properties are copied, made channel data handling safer, and added better logging.
- Strengthened citation entity and URL processing for robustness and type safety.
- Updated ConversationStateManager documentation and clarified default behaviors.
- Modified message forwarding to Copilot Studio to construct a new Activity with the correct conversation ID and relevant properties.
- Improved parameter validation, XML documentation, and removed unused code for better maintainability and clarity.
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 8 out of 8 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Refactored ConversationStateManager to validate arguments and throw exceptions for null/empty values. Updated method signatures and XML docs for clarity. Replaced block comments with line comments in GenesysHandoffAgent.cs. Added using System for exception handling.
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 8 out of 8 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@microsoft microsoft deleted a comment from Copilot AI Feb 20, 2026
@microsoft microsoft deleted a comment from Copilot AI Feb 20, 2026
@siddharthh98 siddharthh98 merged commit f96bc81 into main Feb 20, 2026
7 checks passed
@siddharthh98 siddharthh98 deleted the users/sigaur/fix-citation-and-reaction branch February 20, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Samples Changes to Samples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants