Skip to content

Conversation

@javiercn
Copy link
Contributor

@javiercn javiercn commented Dec 1, 2025

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:

Test Description
ForwardedProps_AreParsedAndPassedToAgent_WhenProvidedInRequestAsync Basic forwarded props parsing
ForwardedProps_WithNestedObjects_AreCorrectlyParsedAsync Nested JSON objects
ForwardedProps_WithArrays_AreCorrectlyParsedAsync JSON arrays
ForwardedProps_WhenEmpty_DoesNotCauseErrorsAsync Empty {} object
ForwardedProps_WhenNotProvided_AgentStillWorksAsync Missing forwardedProps
ForwardedProps_ReturnsValidSSEResponse_WithTextDeltaEventsAsync Full SSE response flow
ForwardedProps_WithMixedTypes_AreCorrectlyParsedAsync Mixed JSON value types

All 7 tests pass successfully.

Fixes

Closes #2468

Copilot AI review requested due to automatic review settings December 1, 2025 10:49
@github-actions github-actions bot changed the title Fix AG-UI forwardedProps JSON property name .NET: Fix AG-UI forwardedProps JSON property name Dec 1, 2025
Copy link
Contributor

Copilot AI left a comment

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.

File Description
dotnet/src/Microsoft.Agents.AI.AGUI/Shared/RunAgentInput.cs Corrected the JSON property name for ForwardedProperties from "forwardedProperties" to "forwardedProps"
dotnet/tests/Microsoft.Agents.AI.Hosting.AGUI.AspNetCore.IntegrationTests/ForwardedPropertiesTests.cs Added 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
@javiercn javiercn added this pull request to the merge queue Dec 2, 2025
Merged via the queue into main with commit b69f994 Dec 2, 2025
14 checks passed
@crickman crickman deleted the fix/agui-forwarded-props-json-name branch December 4, 2025 17:16
This was referenced Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET - AG-UI forwarded properties do not work

5 participants