fix: Dynamic Resource Naming and Agent Management#511
Merged
Conversation
…improved uniqueness
Pavan-Microsoft
requested review from
Avijit-Microsoft,
Prajwal-Microsoft,
Roopan-Microsoft,
Vinay-Microsoft,
aniaroramsft and
brittneek
as code owners
July 2, 2025 06:31
Pavan-Microsoft
marked this pull request as draft
July 2, 2025 06:32
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enables a configurable solution_name for resource and agent naming, improves thread safety in agent deletion, and updates infrastructure templates to include the new environment variable.
- Introduce
solution_nameinConfigand propagate it in Bicep/ARM templates - Update agent factories to include
solution_namein resource names and add locks fordelete_agent - Adjust existing test to reflect the new search index naming convention
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests/api/agents/test_search_agent_factory.py | Updated expected index name to include connection name |
| src/api/common/config/config.py | Added solution_name property to pull SOLUTION_NAME from env |
| src/api/agents/search_agent_factory.py | Prefixed project index and agent names with solution_name; added delete lock |
| src/api/agents/conversation_agent_factory.py | Imported Config, added solution_name to agent name; added delete lock |
| infra/main.json | Added SOLUTION_NAME app setting and updated template hash |
| infra/main.bicep | Passed SOLUTION_NAME parameter into backend module |
Comments suppressed due to low confidence (1)
src/api/agents/conversation_agent_factory.py:27
- Add a unit test for
ConversationAgentFactory.get_agentto verify that the generated agent name includes the configuredsolution_name.
agent_name = f"KM-ConversationKnowledgeAgent-{solution_name}"
Pavan-Microsoft
marked this pull request as ready for review
July 2, 2025 13:12
Avijit-Microsoft
approved these changes
Jul 2, 2025
Contributor
|
🎉 This PR is included in version 3.9.1 🎉 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 introduces changes to integrate a configurable
solution_namevariable across the backend infrastructure and agent factories, enhancing flexibility and enabling better identification of resources. The key updates involve addingsolution_nameto configuration, modifying agent and index naming conventions, and ensuring thread safety in agent deletion methods.Infrastructure Updates:
SOLUTION_NAMEas an environment variable ininfra/main.bicepandinfra/main.jsonto allow dynamic configuration of the solution name. ([[1]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/511/files#diff-7ef659fc9cf6968e718894d300490b14ea7a52091e7d4bcffae3a5029ac721d4R255),[[2]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/511/files#diff-0504f5a35afecd5c8c2a1dc8cac5bb558cc1456c557d8edcb7f9bac1c0dc36e4L2697-R2698))Agent Factory Enhancements:
ConversationAgentFactoryto includesolution_namein agent naming for better resource identification. ([src/api/agents/conversation_agent_factory.pyR21-R27](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/511/files#diff-85b7cc756f7c10f72d7c42fec8f25994e01841a2c743a3fdd063188ba22aed04R21-R27))SearchAgentFactoryto usesolution_namein both agent and index naming conventions, improving clarity and uniqueness. ([[1]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/511/files#diff-296fd5db8f53b31f77b2166ae6f6c5e0aeaeea381455c5d721b4be0294ab7ff6L38-R39),[[2]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/511/files#diff-296fd5db8f53b31f77b2166ae6f6c5e0aeaeea381455c5d721b4be0294ab7ff6L59-R60))Configuration and Thread Safety:
solution_namein theConfigclass to fetch the value from environment variables. ([src/api/common/config/config.pyR44-R45](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/511/files#diff-1a3191ab9957502c87dc45d9d511a75defad29b60e5f5c872c2a9d6a44ab8c85R44-R45))delete_agentmethods ofConversationAgentFactoryandSearchAgentFactory. ([[1]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/511/files#diff-85b7cc756f7c10f72d7c42fec8f25994e01841a2c743a3fdd063188ba22aed04R55),[[2]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/511/files#diff-296fd5db8f53b31f77b2166ae6f6c5e0aeaeea381455c5d721b4be0294ab7ff6R74))Test Adjustments:
test_search_agent_factory.pyto reflect the new naming convention for project indexes. ([src/tests/api/agents/test_search_agent_factory.pyL59-R59](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/511/files#diff-a85cf3e5eb63ca91383d7e80161b754838e88494b727683039f430e2eafff69eL59-R59))Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify citation links.