Skip to content

chore: dev to main merge#866

Open
Ragini-Microsoft wants to merge 17 commits into
mainfrom
dev
Open

chore: dev to main merge#866
Ragini-Microsoft wants to merge 17 commits into
mainfrom
dev

Conversation

@Ragini-Microsoft
Copy link
Copy Markdown
Collaborator

Purpose

This pull request updates the backend to use the latest agent framework and Azure SDKs, refactors agent and chat client usage to match new APIs, and improves system prompt safety patterns. It also makes related changes in the title service and updates dependencies accordingly. The most important changes are summarized below:

Agent Framework & SDK Upgrades:

  • Upgraded agent-framework-core to 1.1.1, replaced agent-framework-azure-ai with agent-framework-foundry 1.1.1, and added agent-framework-orchestrations 1.0.0b260421. Updated azure-ai-projects to 2.1.0 in both backend and VSCode web requirements. [1] [2] [3]

Chat Client & Agent Refactoring:

  • Replaced usage of AzureOpenAIChatClient and its .create_agent() method with direct instantiation of OpenAIChatCompletionClient and Agent objects throughout the orchestrator and title service. Updated initialization logic and parameters to match the new APIs. [1] [2] [3] [4] [5] [6] [7] [8]

System Prompt Pattern Improvements:

  • Enhanced regex patterns for detecting system prompt leakage and agent references, now matching both underscore and hyphen variants for agent names (e.g., triage_agent and triage-agent). [1] [2]

Workflow Event Handling Updates:

  • Refactored event handling in message processing to use event type constants instead of class checks, improving code clarity and type safety. Updated how agent responses and conversation history are extracted and filtered. [1] [2] [3] [4]

Test and Mock Adjustments:

  • Updated orchestrator tests to patch the correct classes and reflect the new direct instantiation of Agent and OpenAIChatCompletionClient. Adjusted builder mocks to support fluent chaining. [1] [2]

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

Akhileswara-Microsoft and others added 14 commits May 21, 2026 13:55
- Update comments referencing AzureOpenAIChatClient to OpenAIChatCompletionClient
- Remove unused TOKEN_ENDPOINT constant from title_service.py
- Remove misleading 'Foundry requires hyphens' comment (name_sep uses underscores)
- Fix HandoffBuilder mock in tests to stub participants(), with_start_agent(),
  and with_termination_condition() for proper chain validation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

Coverage

Coverage Report •
FileStmtsMissCoverMissing
src/backend
   orchestrator.py56210980%37–39, 576, 718, 752–753, 762, 764–765, 767, 773–775, 777, 809–810, 835, 855–857, 864–865, 867–868, 871–873, 875, 885–888, 892–893, 895–896, 904–906, 931, 1032–1034, 1120, 1146, 1188–1190, 1192–1194, 1224–1227, 1310–1312, 1328–1330, 1332–1334, 1348–1351, 1387–1388, 1411, 1459, 1463, 1501, 1533, 1535–1540, 1543, 1568–1569, 1571–1573, 1609, 1612, 1618–1620, 1653, 1689, 1693, 1698, 1777–1785, 1815–1817
src/backend/services
   title_service.py70888%37, 53–54, 73–75, 121–122
src/tests
   test_title_generation_service.py1400100% 
src/tests/services
   test_orchestrator.py1346499%1063, 1080, 1618, 1671
TOTAL769637195% 

Tests Skipped Failures Errors Time
426 0 💤 0 ❌ 0 🔥 12.119s ⏱️

Copy link
Copy Markdown
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 modernizes the backend’s Microsoft Agent Framework integration by upgrading agent framework/Azure SDK dependencies and refactoring orchestrator/title generation code to align with the newer Agent + chat client APIs, while also tightening system-prompt leakage detection patterns and updating tests accordingly.

Changes:

  • Upgrades agent framework packages and azure-ai-projects, and refactors chat client/agent creation to use OpenAIChatCompletionClient + direct Agent(...) instantiation.
  • Switches workflow event handling from class-based checks to event.type dispatch.
  • Updates system-prompt leakage regex patterns and adjusts orchestrator tests/mocks for the new APIs.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/backend/orchestrator.py Refactors chat client + agent initialization, workflow event dispatch, and system prompt leakage patterns.
src/backend/services/title_service.py Updates title agent creation to use OpenAIChatCompletionClient + Agent.
src/backend/requirements.txt Updates agent framework dependencies and bumps azure-ai-projects.
infra/vscode_web/requirements.txt Bumps azure-ai-projects to match backend.
src/tests/services/test_orchestrator.py Updates patches/mocks to reflect direct Agent usage and event.type dispatch.

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

Comment thread src/backend/orchestrator.py Outdated
Comment thread src/backend/orchestrator.py Outdated
Comment thread src/backend/orchestrator.py Outdated
Comment thread src/backend/services/title_service.py Outdated
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.

4 participants