Skip to content

chore: Dev merge to Main#273

Open
Prachig-Microsoft wants to merge 25 commits into
mainfrom
dev
Open

chore: Dev merge to Main#273
Prachig-Microsoft wants to merge 25 commits into
mainfrom
dev

Conversation

@Prachig-Microsoft
Copy link
Copy Markdown
Contributor

This pull request upgrades several dependencies and refactors the agent_framework integration to support recent upstream changes, especially the transition from ChatAgent to Agent and from ToolProtocol to FunctionTool. It also adjusts type annotations and import logic to align with the new agent-framework 1.3.0 API, and adds compatibility for the new DurableAIAgentClient client class.

Dependency Upgrades:

  • Upgraded azure-ai-projects from 1.0.0b12 to 2.1.0 in both infra/vscode_web/endpoint-requirements.txt and infra/vscode_web/requirements.txt.
  • Upgraded agent-framework to 1.3.0, azure-ai-agents to 1.2.0b6, and added idna==3.15 in src/processor/pyproject.toml. [1] [2]
  • Updated werkzeug to 3.1.6 and added idna==3.15 as an override dependency in src/backend-api/pyproject.toml.

Refactoring for agent-framework 1.3.0:

  • Refactored agent_builder.py to replace all usage of ChatAgent with Agent, ToolProtocol with FunctionTool, and updated type annotations and docstrings accordingly. Also updated the middleware and context provider types to match the new API, and removed references to aggregate context providers and old middleware types. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18]

Client creation and compatibility:

  • Updated agent_framework_helper.py to use DurableAIAgentClient instead of the removed Azure OpenAI client classes, and adjusted type hints and import logic for compatibility with agent-framework 1.3.0. [1] [2] [3] [4] [5] [6]

Type and import adjustments:

  • Changed imports and type usage in agent_info.py to use FunctionTool instead of the removed ToolProtocol.## Purpose
  • ...

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

Dhanushree-Microsoft and others added 22 commits May 21, 2026 11:44
fix: update werkzeug to 3.1.6 and add idna 3.15 to dependencies
When callers pass credential=None explicitly, the key exists in kwargs
but the ad_token_provider mapping was skipped. Use kwargs.get() is None
to correctly handle this case.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When callers pass credential=None explicitly, the key exists in kwargs
but the ad_token_provider mapping was skipped. Use kwargs.get() is None
to correctly handle this case.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep agent-framework==1.3.0 upgrade from PR (per user story 43673).
Accept newer general dependency versions from dev branch.
Keep upgraded azure_openai_response_retry.py from PR.

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

- Fix create_agents return type annotation to dict[str, Agent]
- Narrow participants param to Mapping only (Sequence was unused)
- Normalize self.agents with dict() and correct value type
- Replace redundant pass with continue and clarifying comment
- Add teardown_module to test files to restore patched Message class

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Update InputObserverMiddleware to use Message(contents=) instead of
  Message(text=) since agent-framework 1.3.0 renamed the parameter
- Update corresponding tests to verify contents field
- Fix teardown_module signature to accept optional module parameter

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The teardown_module from one test file was restoring the real Message
before another test file's tests ran. Adding setup_module ensures the
stub is re-applied before each module's tests execute.

Also fix test assertion to check contents instead of text since the
middleware now uses Message(contents=).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The middleware now uses Message(contents=) so the test must verify
the contents field, not text.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Set both text= and contents= when constructing Message in
  InputObserverMiddleware for compatibility with downstream code
- Restore missing copyright header in azure_openai_response_retry.py

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

github-actions Bot commented Jun 4, 2026

Coverage

Processor Coverage Report •
FileStmtsMissCoverMissing
src/processor/src/libs/agent_framework
   agent_builder.py1230100% 
   agent_framework_helper.py821186%84, 151, 175, 197, 220, 237, 371, 390, 411, 448–449
   agent_info.py240100% 
   agent_speaking_capture.py66493%206–207, 210, 212
   azure_openai_response_retry.py37114062%91, 201, 209, 231, 257, 267–269, 393, 400–403, 405–407, 413–415, 432, 453–454, 459–462, 465–468, 470–473, 475, 485–487, 489–492, 494–497, 499–503, 505, 513–515, 517, 540–545, 547–549, 555–556, 560–563, 567, 570, 578–579, 585–586, 591, 593, 614, 620–622, 626–627, 643–644, 646–649, 653, 656, 664–665, 671–673, 675–678, 680–691, 694, 701–702, 727–728, 735–736, 738, 742, 745–746, 750–751, 753–755, 763, 765–767, 769–771, 773–774, 784
   coordinator_selection_response.py60100% 
   groupchat_orchestrator.py5439083%129–130, 137–138, 143–144, 471, 474–478, 480, 482–483, 486, 489, 492, 494, 496–499, 506–507, 514–515, 522–523, 526–528, 530–531, 536–538, 541–542, 547, 550–552, 555–556, 561, 564, 570, 573, 577, 579–583, 587–588, 594, 597, 601, 606, 609, 620–621, 623, 625–626, 628, 638–639, 641, 734, 908, 927, 929, 931, 960, 1089, 1091, 1206, 1215, 1217, 1262–1263, 1266, 1287–1290, 1308
   middlewares.py800100% 
   shared_memory_context_provider.py1221190%111, 138, 219, 230, 234, 239, 282, 287, 310–312
src/processor/src/libs/base
   orchestrator_base.py1675070%65, 71, 74–77, 83–84, 86–87, 130, 141, 146, 151–152, 156, 164, 166, 168, 175–176, 183, 189, 191, 198, 202, 211, 215, 220, 222–223, 225, 324–326, 329, 335, 342–344, 371–373, 376, 383, 390–392, 443–444
src/processor/src/libs/mcp_server
   MCPBlobIOTool.py50100% 
   MCPDatetimeTool.py60100% 
   MCPMicrosoftDocs.py30100% 
src/processor/src/steps
   migration_processor.py2644084%88–89, 145–146, 160, 187, 222–223, 229–230, 234, 238, 309–312, 315–318, 322–323, 336–337, 395–396, 496–497, 547–548, 555–556, 594–595, 613–614, 678–679, 703, 732
src/processor/src/steps/analysis/orchestration
   analysis_orchestrator.py85890%46–47, 61, 65, 112, 115, 121, 123
src/processor/src/steps/convert/orchestration
   yaml_convert_orchestrator.py97594%64, 112, 115, 121, 123
src/processor/src/steps/design/orchestration
   design_orchestrator.py82989%42–43, 50, 54, 104, 107, 114–115, 117
src/processor/src/steps/documentation/orchestration
   documentation_orchestrator.py95693%69, 117, 120, 126–127, 129
TOTAL575273687% 

Tests Skipped Failures Errors Time
812 0 💤 0 ❌ 0 🔥 18.969s ⏱️

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

Coverage

Coverage Report •
FileStmtsMissCoverMissing
TOTAL309720893% 
report-only-changed-files is enabled. No files were changed during this commit :)

Tests Skipped Failures Errors Time
588 0 💤 0 ❌ 0 🔥 23.939s ⏱️

Comment thread src/processor/src/steps/migration_processor.py Fixed
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 pull request upgrades key Python dependencies and refactors the processor’s agent_framework integration to align with agent-framework 1.3.0 API changes (notably ChatAgentAgent, ToolProtocolFunctionTool, and the updated workflow event model), plus related test updates.

Changes:

  • Upgraded dependency versions (e.g., agent-framework 1.3.0, azure-ai-projects 2.1.0, werkzeug 3.1.6, idna 3.15) across processor, backend-api, and infra requirements/lockfiles.
  • Refactored orchestration and framework integration to use Agent, Message, WorkflowEvent, and updated client creation (including DurableAIAgentClient compatibility).
  • Updated unit tests to match the new workflow event/message APIs and adjusted middleware/context-provider expectations.

Reviewed changes

Copilot reviewed 29 out of 31 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/processor/src/tests/unit/steps/test_migration_processor_run.py Updates workflow event fixtures to WorkflowEvent.* helpers.
src/processor/src/tests/unit/libs/agent_framework/test_shared_memory_context_provider.py Adjusts context assertions to tolerate context shape changes.
src/processor/src/tests/unit/libs/agent_framework/test_middlewares_extras.py Introduces Message test stubs and patches for middleware compatibility.
src/processor/src/tests/unit/libs/agent_framework/test_input_observer_middleware.py Updates middleware tests for Message/role/content changes.
src/processor/src/tests/unit/libs/agent_framework/test_groupchat_orchestrator_internals.py Updates orchestrator internals tests to Message + string role usage.
src/processor/src/tests/unit/libs/agent_framework/test_agent_framework_helper.py Updates helper tests to reflect removed Azure client classes + Durable client.
src/processor/src/tests/unit/libs/agent_framework/test_agent_builder.py Updates patches from ChatAgent to Agent.
src/processor/src/steps/migration_processor.py Refactors runtime event handling to WorkflowEvent.type + executor_id normalization.
src/processor/src/steps/documentation/orchestration/documentation_orchestrator.py Replaces ToolProtocol annotations with FunctionTool.
src/processor/src/steps/design/orchestration/design_orchestrator.py Replaces ToolProtocol annotations with FunctionTool.
src/processor/src/steps/convert/orchestration/yaml_convert_orchestrator.py Replaces ToolProtocol annotations with FunctionTool.
src/processor/src/steps/analysis/orchestration/analysis_orchestrator.py Replaces ToolProtocol annotations with FunctionTool.
src/processor/src/libs/mcp_server/MCPMicrosoftDocs.py Updates example usage from ChatAgent to Agent.
src/processor/src/libs/mcp_server/MCPDatetimeTool.py Updates example usage from ChatAgent to Agent.
src/processor/src/libs/mcp_server/MCPBlobIOTool.py Updates example usage from ChatAgent to Agent.
src/processor/src/libs/base/orchestrator_base.py Updates agent construction to Agent + adds tool-result compaction strategy + new coordinator response model.
src/processor/src/libs/agent_framework/shared_memory_context_provider.py Refactors provider to Message and introduces a local Context wrapper.
src/processor/src/libs/agent_framework/middlewares.py Updates middleware typing and Message handling for 1.3.0.
src/processor/src/libs/agent_framework/groupchat_orchestrator.py Refactors orchestrator types/events/messages for 1.3.0.
src/processor/src/libs/agent_framework/coordinator_selection_response.py Adds new Coordinator response schema model.
src/processor/src/libs/agent_framework/azure_openai_response_retry.py Retargets retry wrapper to new OpenAIChatClient base and updates call signatures.
src/processor/src/libs/agent_framework/agent_speaking_capture.py Updates middleware context type to AgentContext.
src/processor/src/libs/agent_framework/agent_info.py Updates tool typing to FunctionTool.
src/processor/src/libs/agent_framework/agent_framework_helper.py Updates typing/imports and adds DurableAIAgentClient compatibility handling.
src/processor/src/libs/agent_framework/agent_builder.py Refactors builder to construct Agent and use 1.3.0 types.
src/processor/pyproject.toml Bumps processor dependencies and adds override for idna.
src/backend-api/uv.lock Updates locked versions/overrides (werkzeug/idna).
src/backend-api/pyproject.toml Updates override-dependencies (werkzeug/idna).
infra/vscode_web/requirements.txt Upgrades azure-ai-projects to 2.1.0.
infra/vscode_web/endpoint-requirements.txt Upgrades azure-ai-projects to 2.1.0.

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

Comment thread src/processor/src/libs/base/orchestrator_base.py
… retry check

- Remove unused WorkflowEvent import from migration_processor.py (fixes lint F401)
- Restore 'model produced invalid content' transient error retry in
  azure_openai_response_retry.py (regression from agent-framework 1.3.0 refactor)

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

fix: remove unused WorkflowEvent import and restore 'invalid content' retry check
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

Copilot reviewed 33 out of 35 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

src/processor/src/libs/agent_framework/shared_memory_context_provider.py:312

  • SharedMemoryContextProvider._get_text() doesn’t consider Message.contents, but other code/tests treat .contents as a primary carrier for message content. This can cause empty/incorrect queries and stored memory text when messages populate contents instead of text/content.
        if hasattr(message, "text") and message.text:
            return message.text
        if hasattr(message, "content"):
            return str(message.content) if message.content else ""
        return str(message) if message else ""

Comment on lines 60 to 66
[tool.uv]
prerelease = "allow"
override-dependencies = [
"urllib3==2.7.0",
"authlib==1.7.1",
"idna==3.15",
]
Comment on lines 150 to 153
for message in context.messages:
if message.role == Role.USER and message.text:
if message.role == ROLE_USER and message.text:
original_text = message.text
updated_text = original_text
Comment on lines 95 to 99
for agent in (self.agents or {}).values():
# ChatAgent stores providers in agent.context_provider (AggregateContextProvider)
# Agent stores providers in agent.context_provider (ContextProvider)
# which has a .providers list of individual ContextProvider instances
agg_provider = getattr(agent, "context_provider", None)
if agg_provider is None:
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.

6 participants