Skip to content

Commit 8e20a5e

Browse files
authored
Merge pull request #929 from MicrosoftDocs/main
Merge main to live
2 parents b01a093 + 720b5f3 commit 8e20a5e

7 files changed

Lines changed: 75 additions & 32 deletions

File tree

agent-framework/agents/agent-pipeline.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ zone_pivot_groups: programming-languages
55
author: eavanvalkenburg
66
ms.topic: conceptual
77
ms.author: edvan
8-
ms.date: 03/11/2026
8+
ms.date: 03/20/2026
99
ms.service: agent-framework
1010
---
1111

@@ -45,8 +45,8 @@ The `Agent` class builds a pipeline through class composition with two main comp
4545

4646
**ChatClient** (separate and interchangeable component):
4747

48-
1. **Chat Middleware + Telemetry** - Optional middleware chain and instrumentation layers
49-
2. **FunctionInvocation** - Handles tool calling loop, invoking Function Middleware + Telemetry per tool call
48+
1. **FunctionInvocation** - Handles tool calling loop, invoking Function Middleware + Telemetry per tool call
49+
2. **Chat Middleware + Telemetry** - Optional middleware chain and instrumentation layers, running per model call
5050
3. **RawChatClient** - Provider-specific implementation (Azure OpenAI, OpenAI, Anthropic, etc.) that communicates with the LLM
5151

5252
When you call `run()`, your request flows through the Agent layers, then into the ChatClient pipeline for LLM communication.
@@ -231,9 +231,9 @@ When you invoke an agent, the request flows through the pipeline:
231231

232232
**ChatClient pipeline:**
233233

234-
4. **Chat Middleware + Telemetry** executes (if configured)
235-
5. **FunctionInvocation** sends request to the LLM and handles tool calling loop
234+
4. **FunctionInvocation** manages the tool calling loop
236235
- For each tool call, **Function Middleware + Telemetry** executes
236+
5. **Chat Middleware + Telemetry** executes per model call (if configured)
237237
6. **RawChatClient** handles provider-specific LLM communication
238238
7. Response flows back through the same layers
239239
8. **Context providers** are notified of new messages for storage

agent-framework/agents/conversations/compaction.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,26 @@ zone_pivot_groups: programming-languages
55
author: crickman
66
ms.topic: conceptual
77
ms.author: crickman
8-
ms.date: 03/05/2026
8+
ms.date: 03/18/2026
99
ms.service: agent-framework
1010
---
1111

12+
<!--
13+
Feature parity table – highlight impactful SDK differences between C# and Python.
14+
Keep in sync when features are added or removed.
15+
16+
| Feature | C# | Python | Notes |
17+
|----------------------------------------------|:--:|:------:|-------------------------------------------------------------------------------------------------------------|
18+
| Truncation strategy | ✅ | ✅ | |
19+
| Sliding window strategy | ✅ | ✅ | |
20+
| Tool-result collapse strategy | ✅ | ✅ | |
21+
| Summarization strategy | ✅ | ✅ | |
22+
| Selective tool-call exclusion strategy | ❌ | ✅ | Python-only: fully drops older tool-call groups; C# ToolResultCompactionStrategy collapses them instead |
23+
| Trigger / target predicate system | ✅ | ❌ | C#-only: CompactionTrigger delegates control when each strategy fires and stops; Python strategies use internal parameters |
24+
| Composed pipeline strategy | ✅ | ✅ | C#: PipelineCompactionStrategy (trigger-driven, runs all children); Python: TokenBudgetComposedStrategy (token-budget-driven, early-stop) |
25+
| Post-run compaction of persisted history | ❌ | ✅ | Python-only: CompactionProvider.after_strategy compacts stored history after each run; C# compacts in-flight context only |
26+
-->
27+
1228
# Compaction
1329

1430
As conversations grow, the token count of the chat history can exceed model context windows or drive up costs. Compaction strategies reduce the size of conversation history while preserving important context, so agents can continue functioning over long-running interactions.

agent-framework/agents/middleware/index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ zone_pivot_groups: programming-languages
55
author: dmytrostruk
66
ms.topic: reference
77
ms.author: dmytrostruk
8-
ms.date: 03/16/2026
8+
ms.date: 03/20/2026
99
ms.service: agent-framework
1010
---
1111

@@ -300,6 +300,9 @@ Chat middleware intercepts chat requests sent to AI models. It uses the `ChatCon
300300

301301
The `call_next` callback continues to the next middleware or sends the request to the AI service.
302302

303+
> [!NOTE]
304+
> Chat middleware runs inside the function invocation loop. This means it executes for **each model call**, including calls that send tool results back to the model during a multi-turn tool calling sequence.
305+
303306
### Function-based
304307

305308
```python

agent-framework/agents/providers/azure-openai.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ pip install agent-framework --pre
148148

149149
## Configuration
150150

151+
> [!IMPORTANT]
152+
> The `AzureOpenAIChatClient` and `AzureOpenAIAssistantsClient` require an **Azure OpenAI resource** endpoint (format: `https://<myresource>.openai.azure.com`). The `AzureOpenAIResponsesClient` can use either an Azure OpenAI resource endpoint **or** a [Microsoft Foundry project](/azure/ai-foundry/what-is-ai-foundry) endpoint (format: `https://<your-project>.services.ai.azure.com/api/projects/<project-id>`). If you need to use the Foundry Agent Service instead, see the [Foundry Agents provider page](./azure-ai-foundry.md).
153+
151154
Each client type uses different environment variables:
152155

153156
# [Chat Completion](#tab/aoai-chat-completion)
@@ -228,7 +231,7 @@ asyncio.run(main())
228231

229232
### Responses Client with Microsoft Foundry project endpoint
230233

231-
`AzureOpenAIResponsesClient` can also be created from a Foundry project endpoint:
234+
Instead of an Azure OpenAI resource endpoint, `AzureOpenAIResponsesClient` can also be created from a [Microsoft Foundry project](/azure/ai-foundry/what-is-ai-foundry) endpoint. Use a Foundry project endpoint when you want to access models deployed through a Microsoft Foundry project rather than a standalone Azure OpenAI resource:
232235

233236
```python
234237
from agent_framework.azure import AzureOpenAIResponsesClient

agent-framework/agents/providers/microsoft-foundry.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ For more information on how to run and interact with agents, see the [Agent gett
9898

9999
### Environment Variables
100100

101+
> [!IMPORTANT]
102+
> `AzureAIAgentClient` (Foundry Agent Service v1) and `AzureAIClient` (Foundry Agent Service v2) both require an **Azure AI Foundry project** endpoint (format: `https://<your-project>.services.ai.azure.com/api/projects/<project-id>`), **not** an Azure OpenAI resource endpoint. You must have an [Azure AI Foundry project](/azure/ai-foundry/what-is-ai-foundry) to use this provider. If you have a standalone Azure OpenAI resource instead, see the [Azure OpenAI provider page](./azure-openai.md).
103+
101104
Before using Foundry Agents, you need to set up these environment variables:
102105

103106
```bash

agent-framework/media/agent-pipeline-python.svg

Lines changed: 21 additions & 21 deletions
Loading

agent-framework/support/upgrade/python-2026-significant-changes.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Guide to significant changes in Python releases for Microsoft Agent
44
author: eavanvalkenburg
55
ms.topic: upgrade-and-migration-article
66
ms.author: edvan
7-
ms.date: 03/13/2026
7+
ms.date: 03/20/2026
88
ms.service: agent-framework
99
---
1010
# Python 2026 Significant Changes Guide
@@ -18,9 +18,27 @@ This document will be removed once we reach the 1.0.0 stable release, so please
1818

1919
---
2020

21-
## python-1.0.0rc5 / python-1.0.0b260318 (March 18, 2026)
21+
## python-1.0.0rc5 / python-1.0.0b260319 (March 19, 2026)
2222

23-
**Release:** Scheduled for March 18, 2026. `agent-framework-core` and `agent-framework-azure-ai` move to `1.0.0rc5`; the remaining Python packages align on the March 2026 build line (`1.0.0b260318`).
23+
### 🔴 Chat client pipeline reordered: FunctionInvocation now wraps ChatMiddleware
24+
25+
**PR:** [#4746](https://github.com/microsoft/agent-framework/pull/4746)
26+
27+
The ChatClient pipeline ordering has changed. `FunctionInvocation` is now the outermost layer and wraps `ChatMiddleware`, which means chat middleware runs **per model call** (including each iteration of the tool calling loop) instead of once around the entire function invocation sequence.
28+
29+
**Old pipeline order:**
30+
```
31+
ChatMiddleware → FunctionInvocation → RawChatClient
32+
```
33+
34+
**New pipeline order:**
35+
```
36+
FunctionInvocation → ChatMiddleware → ChatTelemetry → RawChatClient
37+
```
38+
39+
If you have custom chat middleware that assumed it ran only once per agent invocation (wrapping the entire tool calling loop), update it to be safe for repeated execution. Chat middleware is now invoked for each individual LLM request, including requests that send tool results back to the model.
40+
41+
Additionally, `ChatTelemetry` is now a separate layer from `ChatMiddleware` in the pipeline, running closest to `RawChatClient`.
2442

2543
### 🔴 Public runtime kwargs split into explicit buckets
2644

0 commit comments

Comments
 (0)