Skip to content

.NET: Include ReasoningEncryptedContent by default when stored output disabled with Responses#4623

Open
westey-m wants to merge 2 commits intomicrosoft:mainfrom
westey-m:include-reasoningencryptedcontent
Open

.NET: Include ReasoningEncryptedContent by default when stored output disabled with Responses#4623
westey-m wants to merge 2 commits intomicrosoft:mainfrom
westey-m:include-reasoningencryptedcontent

Conversation

@westey-m
Copy link
Contributor

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

  • Include ReasoningEncryptedContent by default for responses when switching off service chat history storage
  • Allow users to not include it, which reduces the response payload, but doesn't work with multi-turn conversations

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings March 11, 2026 14:47
@github-actions github-actions bot changed the title Include ReasoningEncryptedContent by default when stored output disabled with Responses .NET: Include ReasoningEncryptedContent by default when stored output disabled with Responses Mar 11, 2026
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

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 (default true) to AsIChatClientWithStoredOutputDisabled and conditionally adds ReasoningEncryptedContent to IncludedProperties.
  • Added unit tests verifying default/true/false behavior and that the inner ResponsesClient remains accessible.
  • Added a test helper that extracts CreateResponseOptions from 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.

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.

5 participants