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

Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
This commit is contained in:
Mark
2026-07-13 08:37:12 -07:00
committed by GitHub
parent 67aa9cee23
commit 49d997aec3
2 changed files with 41 additions and 2 deletions
@@ -156,6 +156,43 @@ describe("ProviderTransform.options - setCacheKey", () => {
expect(result.store).toBe(false)
})
test("should set store=false for xAI provider by default", () => {
const xaiModel = {
...mockModel,
providerID: "xai",
api: {
id: "grok-4",
url: "https://api.x.ai",
npm: "@ai-sdk/xai",
},
}
const result = ProviderTransform.options({
model: xaiModel,
sessionID,
providerOptions: {},
})
expect(result.store).toBe(false)
expect(result.promptCacheKey).toBe(sessionID)
})
test("should set store=false for xAI SDK regardless of provider ID", () => {
const xaiModel = {
...mockModel,
providerID: "custom-xai",
api: {
id: "grok-4",
url: "https://api.x.ai",
npm: "@ai-sdk/xai",
},
}
const result = ProviderTransform.options({
model: xaiModel,
sessionID,
providerOptions: {},
})
expect(result.store).toBe(false)
})
test("should set store=false for azure provider by default", () => {
const azureModel = {
...mockModel,