.NET: Include ReasoningEncryptedContent by default when stored output disabled with Responses#4623
Open
westey-m wants to merge 2 commits intomicrosoft:mainfrom
Open
.NET: Include ReasoningEncryptedContent by default when stored output disabled with Responses#4623westey-m wants to merge 2 commits intomicrosoft:mainfrom
westey-m wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the OpenAI Responses client extension used by Agent Framework to support optionally including encrypted reasoning tokens when using the Responses API in a stateless configuration (store/stored output disabled).
Changes:
- Added
includeReasoningEncryptedContent(defaulttrue) toAsIChatClientWithStoredOutputDisabledand conditionally addsReasoningEncryptedContenttoIncludedProperties. - Added unit tests verifying default/true/false behavior and that the inner
ResponsesClientremains accessible. - Added a test helper that extracts
CreateResponseOptionsfrom the configured options pipeline via reflection.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIResponseClientExtensions.cs | Adds the new parameter and conditional CreateResponseOptions configuration when stored output is disabled. |
| dotnet/tests/Microsoft.Agents.AI.OpenAI.UnitTests/Extensions/OpenAIResponseClientExtensionsTests.cs | Adds coverage for the new parameter and validates the configured CreateResponseOptions via reflection. |
dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIResponseClientExtensions.cs
Show resolved
Hide resolved
...tests/Microsoft.Agents.AI.OpenAI.UnitTests/Extensions/OpenAIResponseClientExtensionsTests.cs
Show resolved
Hide resolved
SergeyMenshykh
approved these changes
Mar 11, 2026
crickman
approved these changes
Mar 11, 2026
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.
Motivation and Context
When a reasoning model is used and reasoning content items are returned, they do not necessarily contain any content, but only the ids. When coupled with store=false, this causes a failure during a multi-turn conversation, since the service doesn't have the reasoning content that the id refers to. The caller must opt in to returning the reasoning content. This change makes this the default behavior, with an opt out, if the user doesn't care about multi-turn conversations and want to save on the response payload size.
#4562
Description
Contribution Checklist