.NET: Remove AGUI history special cases from ChatClientAgent - #7741
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Removes AG-UI-specific history handling so ChatClientAgent consistently applies provider-agnostic conversation and history semantics.
Changes:
- Removed AG-UI provider-name checks from conversation ID conflict and history-provider resolution.
- Expanded AG-UI integration coverage to verify local two-turn history and absent conversation IDs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs |
Removes AG-UI history special cases. |
dotnet/tests/Microsoft.Agents.AI.Hosting.AGUI.AspNetCore.IntegrationTests/BasicStreamingTests.cs |
Verifies AG-UI local history across two turns. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: Findings reported
Scope: full PR (1 commit(s)): abe5e0d8ba34
Model: gpt-5.6-sol
Overview
The change restores provider-agnostic history ownership for current AGUI.Client, backed by a real-client two-turn integration test that verifies null conversation IDs and four locally retained messages. The generic service-managed-history guards remain well covered. However, removing the provider gate also changes the established contract for the previously published AG-UI client, whose returned thread ID did not mean that it stored history.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
1 verified finding remained after source verification (1 medium) across 1 file. Details are attached to the affected lines below.
Affected areas: dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs
|
Thanks for making the end to end updates Javier Calvarro Nelson (@javiercn)! |
Motivation & Context
ChatClientAgentcontains provider-name checks that exempt AG-UI clients from the normal conversation ID and chat-history rules. CurrentAGUI.Clientfollows Microsoft.Extensions.AI service-managed-history semantics: it keeps AG-UI thread identity on protocol events and does not return aConversationId. The framework no longer needs an AG-UI-specific workaround.Description & Review Guide
ChatClientAgent, restoring the normal provider-agnostic conversation ID andChatHistoryProviderlogic. Strengthened the realAGUI.Clienttwo-turn integration test to verify that no service-managedConversationIdis exposed and that the defaultInMemoryChatHistoryProviderretains both turns.AGUI.Clientreturns noConversationId, while any chat client that does return one now follows the same service-managed-history conflict and provider-disengagement behavior regardless of provider name. Validation passed for the focused AG-UI regression onnet8.0,net9.0, andnet10.0; the ChatClient history-management tests and the fullMicrosoft.Agents.AI.UnitTestsproject passed onnet10.0andnet472(2,039 and 1,903 tests respectively).Related Issue
Fixes #7299
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.