You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chat Completions sends tool arguments and structured tool results as JSON strings. The default serializer indents both strings, adding whitespace to the request.
Use compact JSON for those payloads while retaining the existing serializer settings. String tool results still pass through unchanged.
Both regression tests failed on the indented payloads before the fix. Afterward, the .NET 11 adapter suite passed (398 passed, 163 live integration tests skipped). Both regression tests also passed with reflection-based JSON serialization disabled. The adapter built for all six target frameworks with zero warnings or errors.
You fixed Chat Completions, but the Responses client still sends the same payloads indented: OpenAIResponsesChatClient.ToOpenAIResponseItems serializes FunctionResultContent.Result with AIJsonUtilities.DefaultOptions (L1528) and FunctionCallContent.Arguments the same way (L1596), so a tool loop on GetResponsesClient().AsIChatClient() pays the whitespace from #7921 on every turn. The MCP call and approval arguments (L1606, L1618) and the realtime function result (OpenAIRealtimeClientSession.cs L639) go through DefaultOptions too.
Minor: _toolJsonOptions could live somewhere both clients share, so the two adapters don't drift again.
This branch has not been deployed
No deployments
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
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.
Chat Completions sends tool arguments and structured tool results as JSON strings. The default serializer indents both strings, adding whitespace to the request.
Use compact JSON for those payloads while retaining the existing serializer settings. String tool results still pass through unchanged.
Fixes #7921.
Both regression tests failed on the indented payloads before the fix. Afterward, the .NET 11 adapter suite passed (398 passed, 163 live integration tests skipped). Both regression tests also passed with reflection-based JSON serialization disabled. The adapter built for all six target frameworks with zero warnings or errors.
Microsoft Reviewers: Open in CodeFlow