Repository navigation
fix(prompt): keep OpenAI Responses reasoning items that only carry encrypted content - #2291
Open
elgamal-ahmed wants to merge 1 commit into
Open
elgamal-ahmed wants to merge 1 commit into
elgamal-ahmed wants to merge 1 commit into
Conversation
…crypted content While streaming, a reasoning output item with no summary and no content was treated as hidden reasoning and dropped, even when it carried encrypted_content. With store = false and reasoning.encrypted_content requested, that silently lost the item the next request has to replay, while the non-streaming path kept it. Ignore such an item only when it has no encrypted content either. Closes JetBrains#2287
This branch has not been deployed
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.
Keeps a reasoning output item that carries only
encrypted_contentin the OpenAI Responses streaming path, instead of dropping it.ResponseOutputItemDonetreated an item with no summary and no content as hidden reasoning and returned null, so withstore = falseandinclude = [reasoning.encrypted_content]the encrypted payload never reached the caller and could not be replayed on the next turn, whileprocessResponsesAPIResponsekept the same item. The guard now also requires the encrypted content to be absent, so a genuinely empty hidden item is still ignored. I checked it withisNullOrEmpty()rather than against null, because an empty string would be sent back as"encrypted_content": ""and rejected by the API.Tests: a new
OpenAIResponsesStreamingReasoningTeststreams an encrypted only reasoning item and follows it through to the next request body, where it has to come back with its id and its encrypted content, plus a guard that a fully empty hidden item is still ignored. I have not been able to run the module's jvmTest task locally, so I am relying on CI for it.closes #2287