feat: merging changes from dev to main #248
Conversation
- 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>
Coverage Report •
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
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-aitoagent-framework-foundry/agent-framework-core1.3.0 and update related imports. - Add dynamic provider resolution and a fallback single-agent path using
FoundryAgentwhen 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.
…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
fix: fix format issue
…itation removal and improve text extraction logic
…ion, router) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fix: Pipeline Post deployment GP Testing fix
There was a problem hiding this comment.
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 returnsresult.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."
fix: Resolve Code Quality issue
fix: Update roleDefinitionIdOrName to use GUIDs for Search roles in Bicep.
There was a problem hiding this comment.
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 whenreadyState === 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 becausews.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.textdirectly, 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."
ci: Refactor Docker workflow
|
🎉 This PR is included in version 1.4.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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-aipackage, introduce support for the newagent-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
agent-framework-azure-aitoagent-framework-foundryand 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]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
01_create_agents.pyto 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]src/api/app/routers/chat.py,src/api/app/utils/foundry_agent_utils.py, [1] [2] [3] [4] [5]Improved logging and error handling
src/api/app/main.py,src/api/app/utils/event_utils.py, [1] [2] [3]Test and requirements adjustments
src/tests/utils/test_foundry_agent_utils.py, src/tests/utils/test_foundry_agent_utils.pyL27-R34)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?
How to Test
What to Check
Verify that the following are valid
Other Information