.NET: Forward AG-UI context and additional properties - #7742
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: Findings reported
Scope: full PR (1 commit(s)): fe844e8bcc41
Model: gpt-5.6-sol
Overview
The PR upgrades the coordinated AG-UI package set and adds an end-to-end streaming regression that verifies context and forwarded properties survive the client-to-host path. Central package management keeps the five package versions aligned, and the existing integration suite covers several forwarded-property shapes and absent values. The client upgrade also changes terminal error handling in a way that can make failed runs appear to complete normally to existing callers.
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/Directory.Packages.props
There was a problem hiding this comment.
Pull request overview
Upgrades the coordinated AG-UI SDK packages to enable forwarding context and additional properties through AGUIChatClient.
Changes:
- Updates five AG-UI packages from 0.0.3 to 0.0.5.
- Adds end-to-end regression coverage for context and forwarded properties.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
dotnet/Directory.Packages.props |
Aligns AG-UI dependencies on version 0.0.5. |
dotnet/tests/.../ForwardedPropertiesTests.cs |
Verifies client-to-host request forwarding. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 425c405b-1fd3-4ba6-b332-a195598374b4
| Context = [new AGUIContext { Description = "Current user", Value = "Ada Lovelace" }], | ||
| ForwardedProperties = forwardedProperties, |
There was a problem hiding this comment.
I realise this is just a regression test, so take my comment as a separate suggestion related to this approach, but not this PR.
For A2A we propagate the AdditionalProperties dictionary (where serializable) to the service via the A2A metadata field. So on the client side the A2A Agent converts it to metadata while on the host side it converts the metadata back into additional properties and passes that into the remote agent.
This is quite nice in that it allows a user to pass a value all the way down the stack, and even access it in tool calls on the service side, if the service has an AF agent with MEAI FICC.
Not sure if either of these properties match this concept (perhaps forwarded properties?), but it could be a nice way of integrating well with the abstractions.
// client side:
await agent.RunAsync(
"Do something.",
session,
options: new() { AdditionalProperties = new() { { "tenantId", "tenant-123" } } });
// since additional properties is propagated service side and down to the chat client stack from the MAF agent, we can then do this inside a server side tool:
FunctionInvokingChatClient
.CurrentContext
.Options
.AdditionalProperties
.TryGetValue("tenantId", out string tenantId);
Motivation & Context
AGUIChatClientcould not forwardRunAgentInput.ContextorForwardedPropertiessupplied throughChatOptions.RawRepresentationFactorybecause Agent Framework pinnedAGUI.Client0.0.3. The upstream forwarding fix is available in the 0.0.5 SDK packages.Description & Review Guide
AGUI.Abstractions,AGUI.Formatting,AGUI.Protobuf,AGUI.Client, andAGUI.Serverpackage set from 0.0.3 to 0.0.5, and add an integration regression that sends context and forwarded properties throughAGUIChatClientto the Agent Framework AG-UI endpoint.ChatOptions.RawRepresentationFactoryto populate AG-UI context and forwarded properties in outgoing requests. Existing AG-UI package consumers remain source-compatible.Related Issue
Fixes #6600
This incorporates and supersedes the partial
AGUI.Abstractions-only dependency update in #7579 by upgrading the coordinated AG-UI package set, includingAGUI.Client, which contains the forwarding fix. This PR does not modify or close #7579.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.