Skip to content

.NET: Fix AG-UI forwardedProps JSON property name - #2543

Merged
Javier Calvarro Nelson (javiercn) merged 2 commits into
mainfrom
fix/agui-forwarded-props-json-name
Dec 2, 2025
Merged

.NET: Fix AG-UI forwardedProps JSON property name#2543
Javier Calvarro Nelson (javiercn) merged 2 commits into
mainfrom
fix/agui-forwarded-props-json-name

Conversation

@javiercn

Copy link
Copy Markdown
Contributor

Summary

Fixes the incorrect JSON property name for forwarded properties in the AG-UI protocol implementation.

Problem

The RunAgentInput.ForwardedProperties property in dotnet/src/Microsoft.Agents.AI.AGUI/Shared/RunAgentInput.cs was using the wrong JsonPropertyName attribute value:

  • Before:"forwardedProperties"
  • After:"forwardedProps"

This caused AG-UI clients to be unable to pass forwarded properties to agents since the JSON key didn't match the protocol specification.

Solution

Changed the JsonPropertyName attribute from "forwardedProperties" to "forwardedProps" to match the AG-UI protocol specification.

- [JsonPropertyName("forwardedProperties")]+ [JsonPropertyName("forwardedProps")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public JsonElement ForwardedProperties { get; set; }

Testing

Added comprehensive integration tests in ForwardedPropertiesTests.cs that verify:

TestDescription
ForwardedProps_AreParsedAndPassedToAgent_WhenProvidedInRequestAsyncBasic forwarded props parsing
ForwardedProps_WithNestedObjects_AreCorrectlyParsedAsyncNested JSON objects
ForwardedProps_WithArrays_AreCorrectlyParsedAsyncJSON arrays
ForwardedProps_WhenEmpty_DoesNotCauseErrorsAsyncEmpty {} object
ForwardedProps_WhenNotProvided_AgentStillWorksAsyncMissing forwardedProps
ForwardedProps_ReturnsValidSSEResponse_WithTextDeltaEventsAsyncFull SSE response flow
ForwardedProps_WithMixedTypes_AreCorrectlyParsedAsyncMixed JSON value types

All 7 tests pass successfully.

Fixes

Closes#2468

CopilotAI review requested due to automatic review settings December 1, 2025 10:49
@markwallace-microsoftMark Wallace (markwallace-microsoft) added the .NET Usage: [Issues, PRs], Target: .Net label Dec 1, 2025
@github-actionsgithub-actionsBot changed the title Fix AG-UI forwardedProps JSON property name.NET: Fix AG-UI forwardedProps JSON property nameDec 1, 2025

CopilotAI 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

This pull request fixes a JSON property name mismatch in the AG-UI protocol implementation that was preventing clients from properly passing forwarded properties to agents. The property name has been corrected from "forwardedProperties" to "forwardedProps" to align with the AG-UI protocol specification.

  • Changed JsonPropertyName attribute from "forwardedProperties" to "forwardedProps" in the RunAgentInput class
  • Added comprehensive integration tests covering various scenarios including basic parsing, nested objects, arrays, empty objects, missing properties, SSE responses, and mixed types

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

FileDescription
dotnet/src/Microsoft.Agents.AI.AGUI/Shared/RunAgentInput.csCorrected the JSON property name for ForwardedProperties from "forwardedProperties" to "forwardedProps"
dotnet/tests/Microsoft.Agents.AI.Hosting.AGUI.AspNetCore.IntegrationTests/ForwardedPropertiesTests.csAdded comprehensive integration tests to verify forwarded properties are correctly parsed and passed to agents

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

The RunAgentInput.ForwardedProperties property was using the wrong JSON property
name 'forwardedProperties' instead of 'forwardedProps' per the AG-UI protocol
specification.
This fix:
- Changes JsonPropertyName from 'forwardedProperties' to 'forwardedProps'
- Adds comprehensive integration tests for forwarded properties
Fixes#2468
Merged via the queue into main with commit b69f994Dec 2, 2025
14 checks passed
@crickman
Chris (crickman) deleted the fix/agui-forwarded-props-json-name branch December 4, 2025 17:16
Aris Nguyen (arisng) pushed a commit to arisng/agent-framework that referenced this pull request Feb 2, 2026
* Fix AG-UI forwardedProps JSON property name
The RunAgentInput.ForwardedProperties property was using the wrong JSON property
name 'forwardedProperties' instead of 'forwardedProps' per the AG-UI protocol
specification.
This fix:
- Changes JsonPropertyName from 'forwardedProperties' to 'forwardedProps'
- Adds comprehensive integration tests for forwarded properties
Fixesmicrosoft#2468
* Fix formatting
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NETUsage: [Issues, PRs], Target: .Net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET - AG-UI forwarded properties do not work

5 participants

@javiercn@stephentoub@markwallace-microsoft@crickman