Skip to content

fix(xai): default store to false for Responses#36629

Merged
rekram1-node merged 2 commits into
anomalyco:devfrom
geraint0923:fix/xai-store-false
Jul 13, 2026
Merged

fix(xai): default store to false for Responses#36629
rekram1-node merged 2 commits into
anomalyco:devfrom
geraint0923:fix/xai-store-false

Conversation

@geraint0923

@geraint0923 geraint0923 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Match OpenAI-family stateless Responses defaults so @ai-sdk/xai injects include=["reasoning.encrypted_content"] for multi-turn reasoning rehydration.

Issue for this PR

Closes #36631

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

OpenAI-family Responses clients already default to store: false so multi-turn reasoning can work without server-side stored responses. xAI uses the Responses API via @ai-sdk/xai, but OpenCode never set store: false for it.

In @ai-sdk/xai, when store === false, the Responses language model automatically adds:

include: ["reasoning.encrypted_content"]

Without that, encrypted reasoning is not requested, so follow-up turns can’t get the encrypted state needed for rehydration.

This PR adds @ai-sdk/xai to the same default path as OpenAI / Copilot / Mantle in ProviderTransform.options() and smallOptions(), so xAI models get store: false by default (still with the existing promptCacheKey behavior).

Note: this guarantees we request encrypted reasoning on the response. Full next-turn replay also depends on @ai-sdk/xai input conversion preserving that content; that path still has gaps and is not fully fixed here.

How did you verify your code works?

  • Unit tests in packages/opencode/test/provider/transform.test.ts for xAI defaults (store: false, including custom provider IDs using @ai-sdk/xai)
  • Full transform.test.ts suite: 295 pass
  • Broader test/provider/ + test/session/llm.test.ts: 454 pass
  • Prettier + oxlint on touched files (0 errors)
  • Pre-push typecheck via turbo: 30 packages pass

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

Match OpenAI-family stateless Responses defaults so @ai-sdk/xai
injects include=["reasoning.encrypted_content"] for multi-turn
reasoning rehydration.
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Jul 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot removed needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Jul 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Comment thread packages/opencode/src/provider/transform.ts Outdated
@rekram1-node rekram1-node merged commit 49d997a into anomalyco:dev Jul 13, 2026
8 checks passed
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.

Encrypted reasoning is not enabled for xai models

3 participants