-
Notifications
You must be signed in to change notification settings - Fork 944
.NET: Fix AG-UI forwardedProps JSON property name #2543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
JsonPropertyNameattribute from"forwardedProperties"to"forwardedProps"in theRunAgentInputclass - 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
09e9f47 to
8cd74bd
Compare
Summary
Fixes the incorrect JSON property name for forwarded properties in the AG-UI protocol implementation.
Problem
The
RunAgentInput.ForwardedPropertiesproperty indotnet/src/Microsoft.Agents.AI.AGUI/Shared/RunAgentInput.cswas using the wrongJsonPropertyNameattribute value:"forwardedProperties""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
JsonPropertyNameattribute from"forwardedProperties"to"forwardedProps"to match the AG-UI protocol specification.Testing
Added comprehensive integration tests in
ForwardedPropertiesTests.csthat verify:ForwardedProps_AreParsedAndPassedToAgent_WhenProvidedInRequestAsyncForwardedProps_WithNestedObjects_AreCorrectlyParsedAsyncForwardedProps_WithArrays_AreCorrectlyParsedAsyncForwardedProps_WhenEmpty_DoesNotCauseErrorsAsync{}objectForwardedProps_WhenNotProvided_AgentStillWorksAsyncforwardedPropsForwardedProps_ReturnsValidSSEResponse_WithTextDeltaEventsAsyncForwardedProps_WithMixedTypes_AreCorrectlyParsedAsyncAll 7 tests pass successfully.
Fixes
Closes #2468