fix: replay empty thinking verbatim on preserved-thinking endpoints - #1773
Merged
Conversation
Remove the wire-level fallback that substituted a space for empty thinking content when replaying assistant history to Anthropic-compatible and Kimi endpoints with thinking keep=all. The strict endpoints that motivated the placeholder no longer reject empty thinking, so the placeholder only distorted replayed history.
🦋 Changeset detectedLatest commit: 8917781 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
This was referenced Jul 16, 2026
Merged
Merged
ywh114
pushed a commit
to ywh114/kimi-code
that referenced
this pull request
Jul 19, 2026
…oonshotAI#1773) Remove the wire-level fallback that substituted a space for empty thinking content when replaying assistant history to Anthropic-compatible and Kimi endpoints with thinking keep=all. The strict endpoints that motivated the placeholder no longer reject empty thinking, so the placeholder only distorted replayed 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.
Related Issue
No linked issue. This removes an obsolete wire-level fallback introduced earlier for Anthropic-compatible and Kimi preserved-thinking endpoints.
Problem
When assistant history is replayed to Anthropic-compatible or Kimi endpoints with thinking
keep = "all", the client substituted a single space for missing or empty thinking content: it prepended a placeholder thinking block to assistant messages that had none, replaced the last unsigned thinking block when every thinking block was empty, and sent a space asreasoning_contenton the Kimi protocol. That fallback guarded against strict endpoints that rejected assistant messages with missing or empty thinking. Those endpoints no longer reject such payloads, so the placeholder now only distorts the replayed history.What changed
reasoning_contentcarries the original empty value instead of a space.allkeep values, signed blocks, non-assistant messages) remain as regression coverage.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.