Repository navigation
fix(xai): support encrypted reasoning round-trip for ZDR - #14418
Merged
aayush-kapoor merged 4 commits intoApr 15, 2026
Merged
Conversation
On ZDR (Zero Data Retention) accounts, the xAI responses API returns reasoning with encrypted_content but empty summaries. Two bugs prevented multi-turn conversations from working: 1. doGenerate silently dropped reasoning parts when the summary text was empty, losing the encrypted_content needed for subsequent turns. 2. The input converter skipped all reasoning parts from assistant messages, so encrypted content could never be sent back to the API. Also passes actual store value to input converter instead of hardcoded true.
BrianHung
force-pushed
the
brian/xai-encrypted-reasoning-zdr
branch
from
April 14, 2026 02:03
c76a3c5 to
9843f90
Compare
BrianHung
marked this pull request as ready for review
April 14, 2026 02:03
aayush-kapoor
left a comment
Collaborator
There was a problem hiding this comment.
i'll make these changes
aayush-kapoor
approved these changes
Apr 15, 2026
ghost
pushed a commit
that referenced
this pull request
Apr 15, 2026
|
|
|
🚀 Published in:
|
aayush-kapoor
added a commit
that referenced
this pull request
Apr 15, 2026
…14497) This is an automated backport of #14418 to the release-v6.0 branch. FYI @BrianHung This backport has conflicts that need to be resolved manually. ### `git cherry-pick` output ``` Auto-merging packages/xai/src/responses/convert-to-xai-responses-input.ts CONFLICT (content): Merge conflict in packages/xai/src/responses/convert-to-xai-responses-input.ts Auto-merging packages/xai/src/responses/xai-responses-language-model.test.ts CONFLICT (content): Merge conflict in packages/xai/src/responses/xai-responses-language-model.test.ts Auto-merging packages/xai/src/responses/xai-responses-language-model.ts CONFLICT (content): Merge conflict in packages/xai/src/responses/xai-responses-language-model.ts Auto-merging packages/xai/src/responses/xai-responses-options.ts error: could not apply 8d87577... fix(xai): support encrypted reasoning round-trip for ZDR (#14418) hint: After resolving the conflicts, mark them with hint: "git add/rm <pathspec>", then run hint: "git cherry-pick --continue". hint: You can instead skip this commit with "git cherry-pick --skip". hint: To abort and get back to the state before "git cherry-pick", hint: run "git cherry-pick --abort". hint: Disable this message with "git config set advice.mergeConflict false" ``` --------- Co-authored-by: Brian Hung <[email protected]> Co-authored-by: Aayush Kapoor <[email protected]>
gr2m
pushed a commit
that referenced
this pull request
Jun 5, 2026
On ZDR (Zero Data Retention) accounts, the xAI responses API returns reasoning with `encrypted_content` but empty summaries. Two bugs prevented multi-turn conversations from working: 1. `doGenerate` silently dropped reasoning parts when the summary text was empty, losing the `encrypted_content` needed for subsequent turns. 2. The input converter skipped all reasoning parts from assistant messages, so encrypted content could never be sent back to the API. Also passes actual `store` value to the input converter instead of hardcoded `true`. ## Manual Verification tested by running the example `http://localhost:3000/chat/xai-web-search` with a ZDR enabled key --------- Co-authored-by: Aayush Kapoor <[email protected]> Co-authored-by: Aayush Kapoor <[email protected]>
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.
On ZDR (Zero Data Retention) accounts, the xAI responses API returns reasoning with
encrypted_contentbut empty summaries. Two bugs prevented multi-turn conversations from working:doGeneratesilently dropped reasoning parts when the summary text was empty, losing theencrypted_contentneeded for subsequent turns.Also passes actual
storevalue to the input converter instead of hardcodedtrue.Manual Verification
tested by running the example
http://localhost:3000/chat/xai-web-searchwith a ZDR enabled key