Skip to content

feat: merging changes from dev to main #248

Merged
Avijit-Microsoft merged 40 commits into
mainfrom
dev
Jun 17, 2026
Merged

feat: merging changes from dev to main #248
Avijit-Microsoft merged 40 commits into
mainfrom
dev

Conversation

@Dhanushree-Microsoft

Copy link
Copy Markdown

Purpose

This pull request modernizes and improves agent orchestration for Azure AI Foundry integration, focusing on compatibility with updated agent framework packages and providing robust fallback logic. The changes remove dependencies on the deprecated agent-framework-azure-ai package, introduce support for the new agent-framework-foundry, and ensure that both legacy and new agent orchestration paths are supported. Additionally, the agent creation and invocation logic is refactored for clarity and maintainability.

Key changes include:

Agent framework migration and compatibility

  • Upgraded dependencies from agent-framework-azure-ai to agent-framework-foundry and updated related imports and references throughout the codebase to support the new package structure. (infra/scripts/agent_scripts/requirements.txt, src/api/requirements.txt, [1] [2]
  • Introduced dynamic resolution of the agent provider class (AzureAIProjectAgentProvider) to support both legacy and new agent frameworks, ensuring backward compatibility and smooth transitions. (src/api/app/routers/chat.py, src/api/app/utils/foundry_agent_utils.py, [1] [2] [3]

Refactoring agent creation and orchestration

  • Refactored agent creation logic in 01_create_agents.py to remove the old provider, use the new agent definitions and tools, and simplify the orchestration—now using a helper to build search tools and a unified agent creation function. (infra/scripts/agent_scripts/01_create_agents.py, [1] [2] [3] [4]
  • Updated chat and utility layers to invoke the correct agent orchestration pipeline based on available frameworks, falling back to a single-agent approach when the multi-agent provider is unavailable. (src/api/app/routers/chat.py, src/api/app/utils/foundry_agent_utils.py, [1] [2] [3] [4] [5]

Improved logging and error handling

  • Enhanced logging to suppress deprecation warnings and added warnings when telemetry events cannot be sent due to missing dependencies or configuration. (src/api/app/main.py, src/api/app/utils/event_utils.py, [1] [2] [3]

Test and requirements adjustments

These changes collectively modernize the agent orchestration pipeline, improve maintainability, and ensure robust operation across evolving Azure agent framework packages.

  • ...

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

Prekshith-Microsoft and others added 7 commits May 22, 2026 15:48
- Suppress both 'agent_framework' and 'agent_framework_foundry' loggers
- Update docstring to describe conditional fallback behavior
- Mock parent 'agent_framework' package (with __path__) in all tests

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

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

Coverage

Coverage Report •
FileStmtsMissCoverMissing
main.py952969%57, 69, 71–74, 92, 102, 107, 125–126, 129–131, 134–137, 139–146, 149, 232–233
routers
   chat.py2255575%22, 24–25, 27, 30, 37, 39–40, 54–55, 67–68, 70–72, 80, 92, 148–149, 217–219, 287, 316–320, 322–328, 346, 360–361, 379–380, 425, 427, 441, 451, 453–457, 460–462, 472–473, 475
   voice_live.py3674089%31–34, 155–156, 162–163, 174, 177, 213–216, 237–239, 307–310, 327, 329, 375–377, 380, 383, 385–387, 404–405, 414–415, 616, 645–646, 721, 730
utils
   event_utils.py15473%7–8, 22, 24
   foundry_agent_utils.py95792%44, 54, 101, 135–136, 179, 187
TOTAL240025889% 

Tests Skipped Failures Errors Time
402 0 💤 0 ❌ 0 🔥 10.402s ⏱️

@Dhanushree-Microsoft Dhanushree-Microsoft changed the title Dev feat: merging changes from dev to main Jun 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the solution’s Azure AI Foundry agent integration to work with the newer Agent Framework packages, adds compatibility/fallback logic for environments where the multi-agent provider isn’t available, and refactors agent creation and telemetry handling to be more resilient during package transitions.

Changes:

  • Migrate dependencies from agent-framework-azure-ai to agent-framework-foundry / agent-framework-core 1.3.0 and update related imports.
  • Add dynamic provider resolution and a fallback single-agent path using FoundryAgent when the Azure provider isn’t available.
  • Refactor the agent creation script to build search tools via SDK models and create agent versions via AIProjectClient.

Reviewed changes

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

Show a summary per file
File Description
src/api/requirements.txt Updates Agent Framework dependencies and adjusts VoiceLive extra to include aiohttp.
infra/scripts/agent_scripts/requirements.txt Aligns infra agent-script dependencies to the new Agent Framework packages.
infra/scripts/agent_scripts/01_create_agents.py Refactors agent creation to use SDK model objects and agent version creation APIs.
src/api/app/utils/foundry_agent_utils.py Adds provider resolution and a fallback FoundryAgent call path.
src/api/app/routers/chat.py Adds provider resolution and fallback orchestration inside the legacy chat endpoint.
src/api/app/utils/event_utils.py Makes telemetry dependency optional via dynamic import and adds a warning when unavailable.
src/api/app/main.py Updates log suppression targets for the new Agent Framework packages.
src/tests/utils/test_foundry_agent_utils.py Updates tests to reflect the new module paths and revised “required agent name” behavior.

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

Comment thread infra/scripts/agent_scripts/01_create_agents.py
Comment thread src/api/app/main.py
Comment thread src/api/app/routers/chat.py
Comment thread src/api/app/routers/chat.py
Ayaz-Microsoft and others added 3 commits June 5, 2026 10:28
…iew)

Addresses Copilot review comment: ws.onclose was nulling pendingToolResultRef
without surfacing it to the UI when the socket closed within the 5s fallback
window, silently dropping the assistant answer (#42108).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fix: voice chat mic disable and tool_result flush fallback
Copilot AI review requested due to automatic review settings June 10, 2026 04:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 14 out of 14 changed files in this pull request and generated 4 comments.

Comment thread tests/e2e-test/tests/test_byocc.py
Comment thread src/App/src/lib/textParsers.ts
Comment thread src/api/app/utils/foundry_agent_utils.py Outdated
Comment thread src/api/app/routers/chat.py
Comment thread tests/e2e-test/tests/test_byocc.py Fixed
Comment thread tests/e2e-test/pages/webUserPage.py Fixed
Comment thread tests/e2e-test/pages/webUserPage.py Fixed
Comment thread tests/e2e-test/pages/webUserPage.py Fixed
Comment thread tests/e2e-test/pages/webUserPage.py Fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 14 out of 14 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (1)

src/api/app/utils/foundry_agent_utils.py:194

  • This function introduces citation-stripping via _strip_citations(), but the provider path still returns result.text / str(result) directly, so citation markers like `` can leak through and the behavior differs from the fallback path. Use _result_text(result) for a consistent, cleaned response and to handle None/empty results uniformly.
            if result and hasattr(result, "text"):
                return result.text
            elif result:
                return str(result)
            else:
                return "No response from the agent."

Comment thread src/api/app/utils/foundry_agent_utils.py
Comment thread src/api/app/utils/foundry_agent_utils.py
Comment thread tests/e2e-test/tests/test_byocc.py
Comment thread tests/e2e-test/tests/test_byocc.py
Comment thread tests/e2e-test/tests/test_byocc.py
Comment thread tests/e2e-test/tests/test_byocc.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 18 out of 18 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (2)

src/App/src/components/EnhancedChatPanel.tsx:345

  • stopVoiceSession() only closes the WebSocket when readyState === OPEN. If teardown happens while the socket is still CONNECTING (e.g., cold-start timeout firing, or an early error), the connection attempt may continue in the background because ws.close() is never called. Closing for any non-CLOSED state avoids leaks and reduces flakiness.
    const ws = wsRef.current;
    wsRef.current = null;

    if (ws && ws.readyState === WebSocket.OPEN) {
      ws.send(JSON.stringify({ type: 'stop_session' }));
      ws.close();
    }

src/api/app/utils/foundry_agent_utils.py:194

  • When the provider-based path is used, this returns result.text directly, while the fallback routing path applies _strip_citations(). That means citation markers like `` can leak to clients depending on which orchestration path is active. Returning _result_text(result) here keeps behavior consistent across both paths.
            if result and hasattr(result, "text"):
                return result.text
            elif result:
                return str(result)
            else:
                return "No response from the agent."

Comment thread tests/e2e-test/tests/test_byocc.py
Comment thread src/api/app/routers/voice_live.py
Comment thread tests/e2e-test/tests/test_byocc.py Dismissed
Comment thread tests/e2e-test/pages/webUserPage.py Dismissed
Comment thread tests/e2e-test/pages/webUserPage.py Dismissed
Comment thread tests/e2e-test/pages/webUserPage.py Dismissed
Comment thread tests/e2e-test/pages/webUserPage.py Dismissed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.