Repository navigation
fix(translate): filter empty reasoning before input IR - #717
Merged
Merged
Conversation
Responses reasoning can contain summary or content arrays whose text is entirely empty. Treating array presence as readable content produced empty thinking blocks with empty signatures on Messages targets. Discard empty text parts while reading Responses input, and omit reasoning when neither channel contains text. Preserve nonempty text and authenticated native replay, including signed empty thinking blocks. Cover empty and mixed channels at the IR boundary, the Messages tool-history projection, and signed native replay.
Skip empty Gemini thoughts before emitting input reasoning, and skip empty Messages thinking before flushing adjacent visible text. Keep nonempty reasoning text and positional identities intact. Cover empty reasoning at every source boundary, including Chat extensions, and update the Gemini-to-Messages expectation to omit empty thought history.
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.
Empty Responses reasoning summaries and Gemini thought parts could enter input IR and become
{ type: "thinking", thinking: "", signature: "" }on Messages targets. The reported Responses request contains 28 such empty summaries.Filter empty reasoning before constructing input IR. The Responses reader removes empty text parts from summary and content and omits reasoning when both channels are empty. The Gemini reader skips empty thought text. The Messages reader skips empty thinking before segmenting visible text, so an empty block cannot split adjacent text. Chat Completions reasoning extensions already stay outside input IR; a regression test covers their empty forms.
Nonempty text and Gemini reasoning positions remain intact. Authenticated native replay continues to preserve signed thinking blocks whose text is empty.
Test Plan
78c262d95689c9b226e5d36ef441f53c4812cee7.