Skip to content

Conversation

@joseharriaga
Copy link
Collaborator

In addition to offering the expected functionality, this change also fixes #779. That is because the failure reported in this issue is by design, and to fix it, users must request the encrypted reasoning content via the included properties like this:

ResponseCreationOptions options = new()
{
    StoredOutputEnabled = false,
    IncludedProperties = { IncludedResponseProperty.ReasoningEncryptedContent }
};

For more context, see the following docs:

When using the Responses API in a stateless mode (either with store set to false, or when an organization is enrolled in zero data retention), you must still retain reasoning items across conversation turns using the techniques described above. But in order to have reasoning items that can be sent with subsequent API requests, each of your API requests must have reasoning.encrypted_content in the include parameter of API requests ... Any reasoning items in the output array will now have an encrypted_content property, which will contain encrypted reasoning tokens that can be passed along with future conversation turns.

From: 🔗 https://platform.openai.com/docs/guides/reasoning#encrypted-reasoning-items

@joseharriaga joseharriaga force-pushed the joseharriaga/IncludedResponseProperties branch from 12196d4 to 7d0b7ac Compare November 7, 2025 23:16
@joseharriaga joseharriaga requested review from Copilot and removed request for ShivangiReja and trrwilson November 8, 2025 00:18
Copy link

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

This PR renames the internal InternalIncludable type to IncludedResponseProperty and makes it public, supporting the new "include" feature for OpenAI Response API calls. The change enables developers to specify which optional properties (like encrypted reasoning content) should be included in responses.

Key changes:

  • Renamed InternalIncludableIncludedResponseProperty and made it public with [Experimental("OPENAI001")] attribute
  • Updated ResponseCreationOptions.Include property to IncludedProperties with public access
  • Added include_obfuscation query parameter support to GetResponse operations
  • Added test coverage for reasoning with store disabled using the new include functionality

Reviewed Changes

Copilot reviewed 11 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Generated/Models/Responses/InternalIncludable.cs Removed (deleted internal type)
src/Custom/Responses/Internal/InternalIncludable.cs Removed (deleted internal type)
src/Generated/Models/Responses/IncludedResponseProperty.cs New public struct replacing InternalIncludable
src/Custom/Responses/IncludedResponseProperty.cs Custom partial with renamed property members
src/Generated/Models/Responses/ResponseCreationOptions.cs Updated to use IncludedResponseProperty
src/Generated/Models/Responses/ResponseCreationOptions.Serialization.cs Updated serialization for renamed property
src/Custom/Responses/ResponseCreationOptions.cs Made IncludedProperties public
src/Generated/OpenAIResponseClient.cs Added GetResponse overloads with new parameters
src/Generated/OpenAIResponseClient.RestClient.cs Updated to use IncludedResponseProperty and add include_obfuscation parameter
src/Custom/Responses/OpenAIResponseClient.cs Updated method signatures for GetResponse operations
src/Custom/Responses/OpenAIResponseClient.Protocol.cs Removed (functionality moved to generated code)
src/Generated/OpenAIModelFactory.cs Added factory method for ResponseCreationOptions
tests/Responses/ResponsesTests.cs Added test for reasoning with store disabled
tests/SessionRecords/ResponsesTests/*.json Test recordings for new test cases
specification/base/typespec/responses/operations.tsp Updated getResponse operation signature
api/OpenAI.netstandard2.0.cs Updated API surface
api/OpenAI.net8.0.cs Updated API surface

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,11 @@
namespace OpenAI.Responses;

[CodeGenType("Includable")]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Man, Krzysztof would be twitching if he saw a member named "Includable"

response_id: string,

@query(#{ name: "include[]", explode: true })
includables?: Includable[] = #[],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WTF even is #[] ?

public readonly partial struct IncludedResponseProperty
{
[CodeGenMember("MessageInputImageImageUrl")]
public static IncludedResponseProperty MessageInputImageUri { get; } = new IncludedResponseProperty(MessageInputImageImageUrlValue);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@clientName can't do this? That seems like something it should cover...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Responses: Can't propagate a reasoning item from previous interaction's output into next interaction's input (serialization of 'id')

3 participants