Skip to content

Conversation

@eavanvalkenburg
Copy link
Member

@eavanvalkenburg eavanvalkenburg commented Jan 8, 2026

Motivation and Context

First round of updates to based on the reviews we've been going through.

  • Used attributes rather then properties for members of protocols (items 1 and 2)
  • Removed display_name (item 3)
  • Renamed context_provider to singular, only allow 1 context provider, removed AggregateContextProvider from code, added sample with that as inspiration, if users need multiple they can leverage that or roll their own. (item 5)
  • Renamed middleware to multiple (middlewares), and mandate a list of middlewares instead of single or list. (item 6)
  • refactored some test classes accordingly
  • remove some init.py files from test folders, as that breaks test discovery in some instances

Addresses several items in #2902

Description

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings January 8, 2026 13:12
@eavanvalkenburg eavanvalkenburg requested a review from a team as a code owner January 8, 2026 13:12
@markwallace-microsoft markwallace-microsoft added documentation Improvements or additions to documentation python labels Jan 8, 2026
Copy link
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 implements breaking changes to simplify and clarify the Agent Framework API by:

  • Removing the display_name property (agents now use name or id directly)
  • Converting AgentProtocol from properties to attributes for better protocol definition
  • Renaming middleware to middlewares (consistently as a list)
  • Renaming context_providers to context_provider (singular)
  • Removing AggregateContextProvider from the core framework and providing it as a sample implementation

Key Changes

  • Simplification of agent identification by removing redundant display_name
  • Consistent parameter naming with middlewares always being a list
  • Singular context_provider parameter reflecting that agents have one provider (which can be an aggregate)

Reviewed changes

Copilot reviewed 91 out of 92 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
Python samples (middleware/*.py) Updated all middleware parameter references from middleware to middlewares
Python samples (context_providers/*.py) Updated context provider parameter from context_providers to context_provider
Python samples (observability/*.py) Replaced agent.display_name with agent.name
Python samples (aggregate_context_provider.py) New sample showing how to implement AggregateContextProvider
agent_framework/_agents.py Changed AgentProtocol to use attributes instead of properties; removed display_name
agent_framework/_memory.py Removed AggregateContextProvider class from core
agent_framework/_clients.py Updated parameter names to context_provider and middlewares
agent_framework/_middleware.py Updated all middleware references and documentation
agent_framework/_workflows/ Updated handoff and participant logic to use name/id instead of display_name
agent_framework/observability.py Updated telemetry to use name or id fallback
TypeScript files (devui/frontend) Updated to reflect new parameter names
Test files Updated all test cases to use new parameter names and removed display_name assertions
Integration test files Removed init.py files and fixed import paths

@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Jan 8, 2026

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/azurefunctions/agent_framework_azurefunctions
   _orchestration.py991287%109–110, 114, 333, 338–345
packages/copilotstudio/agent_framework_copilotstudio
   _agent.py75494%153–154, 189, 197
packages/core/agent_framework
   _agents.py2755081%349–351, 397, 451, 619, 800, 803–805, 941–944, 946, 949–951, 1047, 1088, 1090, 1099–1104, 1110, 1112, 1122–1123, 1130, 1132–1133, 1141–1145, 1153–1154, 1156, 1161, 1163, 1197, 1242–1243, 1245, 1247, 1258
   _clients.py102991%267, 378, 426–429, 473, 802, 804
   _memory.py26580%113, 134, 152, 162, 179
   _middleware.py4041197%805, 821, 868–869, 1072–1073, 1118, 1268, 1486, 1541–1542
   _serialization.py1051090%335, 347–348, 357, 516, 532, 542, 554, 610, 613
   _threads.py1362184%145, 177–178, 180, 257–260, 343, 355, 467–471, 474–475, 494, 496, 499, 505
   _tools.py7116790%224, 270, 321, 323, 486, 518–519, 621, 623, 643, 661, 675, 687, 692, 694, 701, 734, 788–790, 831, 854, 856–865, 874–880, 916, 926, 1110, 1524–1528, 1649, 1718, 1811, 1817, 1860–1861, 1874–1875, 2004, 2045–2046, 2074–2076, 2118–2119, 2184–2185, 2192–2193
   observability.py64215476%244, 312–317, 319, 321–322, 324, 326–328, 331–333, 338–339, 345–346, 352–353, 360, 362–364, 367–369, 374–375, 381–382, 388–389, 396, 433, 436, 439–441, 444, 447–448, 451–453, 455–457, 460, 547, 549, 631, 649–650, 652, 655, 663–664, 667–670, 672, 675–677, 680–681, 694–700, 702–711, 714–718, 721–724, 726–729, 732–733, 741, 842, 844, 869–871, 993, 995, 999–1004, 1006, 1009–1013, 1015, 1285, 1365–1367, 1439–1441, 1614, 1622, 1626, 1630, 1636, 1638, 1640, 1648, 1658, 1699–1702, 1716, 1718, 1725, 1741, 1744, 1804, 1820, 1824, 1958, 1960
packages/core/agent_framework/_workflows
   _handoff.py61514276%63, 76–78, 85–86, 88, 90, 204, 212–217, 220–221, 235, 240, 259–262, 271–273, 284, 287, 297–308, 310, 316, 322, 357, 373, 375, 378, 380, 429, 538, 547–552, 554–555, 566, 583, 601, 616, 628, 650, 662–664, 670, 713–715, 718–721, 723–725, 1087, 1092, 1096, 1101, 1176, 1186, 1279, 1282, 1298, 1303, 1315, 1321–1324, 1367–1368, 1507, 1789, 1801, 1824, 1830, 1839, 1843, 1848, 1868, 1890, 1901, 1913, 1946, 1957, 1961, 1963–1967, 1983–1985, 1987–1994, 1996–1998, 2000–2001, 2003, 2005, 2025–2031, 2033, 2039
   _participant_utils.py76396%40, 52, 65
   _sequential.py1121685%73, 87, 158, 178, 189, 195, 241, 243–245, 260, 267, 297, 301–302, 315
packages/core/agent_framework/openai
   _shared.py1001288%63, 69–72, 150, 152, 159, 161, 174, 250, 274
packages/purview/agent_framework_purview
   _middleware.py931188%68–70, 95, 97–99, 103, 163, 187, 191
TOTAL16803260484% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
2577 154 💤 0 ❌ 0 🔥 1m 1s ⏱️

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

Labels

documentation Improvements or additions to documentation python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants