Skip to content

.NET: Forward AG-UI context and additional properties - #7742

Merged
Roger Barreto (rogerbarreto) merged 2 commits into
mainfrom
javiercn-upgrade-agui-sdk-packages
Aug 19, 2026
Merged

.NET: Forward AG-UI context and additional properties#7742
Roger Barreto (rogerbarreto) merged 2 commits into
mainfrom
javiercn-upgrade-agui-sdk-packages

Conversation

@javiercn

Copy link
Copy Markdown
Contributor

Motivation & Context

AGUIChatClient could not forward RunAgentInput.Context or ForwardedProperties supplied through ChatOptions.RawRepresentationFactory because Agent Framework pinned AGUI.Client 0.0.3. The upstream forwarding fix is available in the 0.0.5 SDK packages.

Description & Review Guide

  • What are the major changes? Upgrade the coordinated AGUI.Abstractions, AGUI.Formatting, AGUI.Protobuf, AGUI.Client, and AGUI.Server package set from 0.0.3 to 0.0.5, and add an integration regression that sends context and forwarded properties through AGUIChatClient to the Agent Framework AG-UI endpoint.
  • What is the impact of these changes? Callers can now use ChatOptions.RawRepresentationFactory to populate AG-UI context and forwarded properties in outgoing requests. Existing AG-UI package consumers remain source-compatible.
  • What do you want reviewers to focus on? Confirm the coordinated package upgrade and the end-to-end request forwarding coverage.

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, including AGUI.Client, which contains the forwarding fix. This PR does not modify or close #7579.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread dotnet/Directory.Packages.props

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Comment on lines +44 to +45
Context = [new AGUIContext { Description = "Current user", Value = "Ada Lovelace" }],
ForwardedProperties = forwardedProperties,

@westey-m westey (westey-m) Aug 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Merged via the queue into main with commit 064751c Aug 19, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Usage: [Issues, PRs], Target: .Net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET: [Bug]: AGUIChatClient doesnt forward/populate AdditionalProperties

4 participants