@ai-sdk/openai 3.0.64 → 3.0.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/openai",
3
- "version": "3.0.64",
3
+ "version": "3.0.65",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -55,6 +55,7 @@ export async function convertToOpenAIResponsesInput({
55
55
  passThroughUnsupportedFiles = false,
56
56
  store,
57
57
  hasConversation = false,
58
+ hasPreviousResponseId = false,
58
59
  hasLocalShellTool = false,
59
60
  hasShellTool = false,
60
61
  hasApplyPatchTool = false,
@@ -68,6 +69,7 @@ export async function convertToOpenAIResponsesInput({
68
69
  passThroughUnsupportedFiles?: boolean;
69
70
  store: boolean;
70
71
  hasConversation?: boolean; // when true, skip assistant messages that already have item IDs
72
+ hasPreviousResponseId?: boolean; // when true, skip reasoning and function-call items that already exist in the previous response chain
71
73
  hasLocalShellTool?: boolean;
72
74
  hasShellTool?: boolean;
73
75
  hasApplyPatchTool?: boolean;
@@ -268,6 +270,9 @@ export async function convertToOpenAIResponsesInput({
268
270
  }
269
271
 
270
272
  if (store && id != null) {
273
+ if (hasPreviousResponseId) {
274
+ break;
275
+ }
271
276
  input.push({ type: 'item_reference', id });
272
277
  break;
273
278
  }
@@ -466,7 +471,10 @@ export async function convertToOpenAIResponsesInput({
466
471
 
467
472
  const reasoningId = providerOptions?.itemId;
468
473
 
469
- if (hasConversation && reasoningId != null) {
474
+ if (
475
+ (hasConversation || hasPreviousResponseId) &&
476
+ reasoningId != null
477
+ ) {
470
478
  break;
471
479
  }
472
480
 
@@ -233,6 +233,7 @@ export class OpenAIResponsesLanguageModel implements LanguageModelV3 {
233
233
  openaiOptions?.passThroughUnsupportedFiles ?? false,
234
234
  store: openaiOptions?.store ?? true,
235
235
  hasConversation: openaiOptions?.conversation != null,
236
+ hasPreviousResponseId: openaiOptions?.previousResponseId != null,
236
237
  hasLocalShellTool: hasOpenAITool('openai.local_shell'),
237
238
  hasShellTool: hasOpenAITool('openai.shell'),
238
239
  hasApplyPatchTool: hasOpenAITool('openai.apply_patch'),