fix: enhance agent creation logic to reuse existing agents across Chart, Conversation, Search, and SQL factories#669
Merged
Merged
Conversation
…art, Conversation, Search, and SQL factories
Pavan-Microsoft
requested review from
Avijit-Microsoft,
Prajwal-Microsoft,
Roopan-Microsoft,
Vinay-Microsoft,
aniaroramsft,
brittneek,
nchandhi and
toherman-msft
as code owners
December 2, 2025 05:44
Avijit-Microsoft
approved these changes
Dec 2, 2025
Contributor
|
🎉 This PR is included in version 3.16.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Purpose
This pull request refactors the agent factory classes to optimize agent creation and improve logging. The main change is that each factory now checks for an existing agent with the expected name before creating a new one, ensuring agent reuse and reducing resource duplication. Additionally, logging is standardized and improved across all agent factories for better traceability and error handling.
Agent creation logic improvements:
ChartAgentFactory,SQLAgentFactory,SearchAgentFactory, andConversationAgentFactory) now attempt to find and reuse an existing agent with the expected name before creating a new one, reducing unnecessary agent creation. [1] [2] [3] [4]Logging enhancements:
loggingimports and initialized loggers in all agent factory files to standardize logging. [1] [2] [3] [4]ConversationAgentFactoryby replacingprintstatements withlogger.error.Documentation updates:
Consistency improvements:
solution_nameacross all factories. [1] [2] [3] [4]Error handling:
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation