.NET: fix: tolerate raw AGUI tool result strings#6221
Open
he-yufeng wants to merge 1 commit into
Open
Conversation
29fa618 to
f174656
Compare
Contributor
Author
|
Rebased on current Validated: dotnet build .\tests\Microsoft.Agents.AI.AGUI.UnitTests\Microsoft.Agents.AI.AGUI.UnitTests.csproj -f net10.0 -c Debug --tl:off
dotnet test --project .\tests\Microsoft.Agents.AI.AGUI.UnitTests\Microsoft.Agents.AI.AGUI.UnitTests.csproj -f net10.0 -c Debug --no-build -v Normal --report-xunit-trx --ignore-exit-code 8 -- --filter-class Microsoft.Agents.AI.AGUI.UnitTests.ChatResponseUpdateAGUIExtensionsTests
git diff --check upstream/main...HEADAll passed after the rebase. |
f174656 to
5392ea8
Compare
Contributor
Author
|
Rebased this PR onto the latest upstream Validation:
|
5392ea8 to
b5e84a1
Compare
Contributor
Author
|
Rebased this branch onto current Validation run locally from
I used |
Contributor
Author
|
Rebased this branch onto current main and pushed the updated head $head. Validation run locally from dotnet/:
|
d385f42 to
65a2012
Compare
65a2012 to
c3c4d32
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6220.
The AGUI converter serialized
FunctionResultContentstring values as raw text. The inbound AGUI -> MEAI path then parsed every tool result as JSON, so raw string content such asSuccess: Function completed.orTruecould throwJsonException.This patch makes outbound string tool results valid JSON strings, while keeping the inbound path tolerant of older or external raw string content. Existing JSON object, bool, and number payloads still deserialize as
JsonElement.To verify
dotnet build dotnet\tests\Microsoft.Agents.AI.AGUI.UnitTests\Microsoft.Agents.AI.AGUI.UnitTests.csproj --no-restoredotnet dotnet\tests\Microsoft.Agents.AI.AGUI.UnitTests\bin\Debug\net10.0\Microsoft.Agents.AI.AGUI.UnitTests.dll --filter-class Microsoft.Agents.AI.AGUI.UnitTests.ChatResponseUpdateAGUIExtensionsTests --no-progressdotnet\tests\Microsoft.Agents.AI.AGUI.UnitTests\bin\Debug\net472\Microsoft.Agents.AI.AGUI.UnitTests.exe --filter-class Microsoft.Agents.AI.AGUI.UnitTests.ChatResponseUpdateAGUIExtensionsTests --no-progressdotnet dotnet\tests\Microsoft.Agents.AI.AGUI.UnitTests\bin\Debug\net10.0\Microsoft.Agents.AI.AGUI.UnitTests.dll --no-progressdotnet\tests\Microsoft.Agents.AI.AGUI.UnitTests\bin\Debug\net472\Microsoft.Agents.AI.AGUI.UnitTests.exe --no-progressdotnet format dotnet\tests\Microsoft.Agents.AI.AGUI.UnitTests\Microsoft.Agents.AI.AGUI.UnitTests.csproj --include dotnet\src\Microsoft.Agents.AI.AGUI\Shared\ChatResponseUpdateAGUIExtensions.cs dotnet\tests\Microsoft.Agents.AI.AGUI.UnitTests\ChatResponseUpdateAGUIExtensionsTests.cs --verify-no-changes --no-restoregit diff --check