@ai-sdk/openai 3.0.72 → 3.0.73

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.72",
3
+ "version": "3.0.73",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -36,8 +36,8 @@
36
36
  }
37
37
  },
38
38
  "dependencies": {
39
- "@ai-sdk/provider-utils": "4.0.30",
40
- "@ai-sdk/provider": "3.0.10"
39
+ "@ai-sdk/provider": "3.0.10",
40
+ "@ai-sdk/provider-utils": "4.0.30"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "20.17.24",
@@ -281,10 +281,29 @@ export async function convertToOpenAIResponsesInput({
281
281
  break;
282
282
  }
283
283
 
284
- if (store && id != null) {
285
- if (hasPreviousResponseId) {
286
- break;
287
- }
284
+ // When chaining with a previous response id, items already part
285
+ // of that response chain must not be resent.
286
+ if (hasPreviousResponseId && store && id != null) {
287
+ break;
288
+ }
289
+
290
+ // Provider-defined tool calls (local_shell, shell, apply_patch,
291
+ // and custom tools) are stored by the API and can be sent as an
292
+ // `item_reference` to reduce payload size. Plain client-executed
293
+ // function calls must NOT be: the matching `function_call_output`
294
+ // can only reference the call by `call_id` (`call_...`), which
295
+ // the API cannot reconcile with an item id (`fc_...`) or an
296
+ // `item_reference`. Sending either breaks call/output pairing and
297
+ // makes follow-up requests fail with "No tool call found for
298
+ // function call output with call_id", most visibly with parallel
299
+ // tool calls across multiple steps.
300
+ const isProviderDefinedToolCall =
301
+ (hasLocalShellTool && resolvedToolName === 'local_shell') ||
302
+ (hasShellTool && resolvedToolName === 'shell') ||
303
+ (hasApplyPatchTool && resolvedToolName === 'apply_patch') ||
304
+ (customProviderToolNames?.has(resolvedToolName) ?? false);
305
+
306
+ if (store && id != null && isProviderDefinedToolCall) {
288
307
  input.push({ type: 'item_reference', id });
289
308
  break;
290
309
  }
@@ -366,7 +385,6 @@ export async function convertToOpenAIResponsesInput({
366
385
  call_id: part.toolCallId,
367
386
  name: resolvedToolName,
368
387
  arguments: serializeToolCallArguments(part.input),
369
- id,
370
388
  ...(namespace != null && { namespace }),
371
389
  });
372
390
  break;