@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.
@@ -2699,7 +2699,7 @@ async function convertToOpenAIResponsesInput({
2699
2699
  hasApplyPatchTool = false,
2700
2700
  customProviderToolNames
2701
2701
  }) {
2702
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
2702
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
2703
2703
  let input = [];
2704
2704
  const warnings = [];
2705
2705
  const processedApprovalIds = /* @__PURE__ */ new Set();
@@ -2836,10 +2836,11 @@ async function convertToOpenAIResponsesInput({
2836
2836
  }
2837
2837
  break;
2838
2838
  }
2839
- if (store && id != null) {
2840
- if (hasPreviousResponseId) {
2841
- break;
2842
- }
2839
+ if (hasPreviousResponseId && store && id != null) {
2840
+ break;
2841
+ }
2842
+ const isProviderDefinedToolCall = hasLocalShellTool && resolvedToolName === "local_shell" || hasShellTool && resolvedToolName === "shell" || hasApplyPatchTool && resolvedToolName === "apply_patch" || ((_m = customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) != null ? _m : false);
2843
+ if (store && id != null && isProviderDefinedToolCall) {
2843
2844
  input.push({ type: "item_reference", id });
2844
2845
  break;
2845
2846
  }
@@ -2910,7 +2911,6 @@ async function convertToOpenAIResponsesInput({
2910
2911
  call_id: part.toolCallId,
2911
2912
  name: resolvedToolName,
2912
2913
  arguments: serializeToolCallArguments2(part.input),
2913
- id,
2914
2914
  ...namespace != null && { namespace }
2915
2915
  });
2916
2916
  break;
@@ -2927,7 +2927,7 @@ async function convertToOpenAIResponsesInput({
2927
2927
  part.toolName
2928
2928
  );
2929
2929
  if (resolvedResultToolName === "tool_search") {
2930
- const itemId = (_o = (_n = (_m = part.providerOptions) == null ? void 0 : _m[providerOptionsName]) == null ? void 0 : _n.itemId) != null ? _o : part.toolCallId;
2930
+ const itemId = (_p = (_o = (_n = part.providerOptions) == null ? void 0 : _n[providerOptionsName]) == null ? void 0 : _o.itemId) != null ? _p : part.toolCallId;
2931
2931
  if (store) {
2932
2932
  input.push({ type: "item_reference", id: itemId });
2933
2933
  } else if (part.output.type === "json") {
@@ -2968,7 +2968,7 @@ async function convertToOpenAIResponsesInput({
2968
2968
  break;
2969
2969
  }
2970
2970
  if (store) {
2971
- const itemId = (_r = (_q = (_p = part.providerOptions) == null ? void 0 : _p[providerOptionsName]) == null ? void 0 : _q.itemId) != null ? _r : part.toolCallId;
2971
+ const itemId = (_s = (_r = (_q = part.providerOptions) == null ? void 0 : _q[providerOptionsName]) == null ? void 0 : _r.itemId) != null ? _s : part.toolCallId;
2972
2972
  input.push({ type: "item_reference", id: itemId });
2973
2973
  } else {
2974
2974
  warnings.push({
@@ -3078,7 +3078,7 @@ async function convertToOpenAIResponsesInput({
3078
3078
  }
3079
3079
  const output = part.output;
3080
3080
  if (output.type === "execution-denied") {
3081
- const approvalId = (_t = (_s = output.providerOptions) == null ? void 0 : _s.openai) == null ? void 0 : _t.approvalId;
3081
+ const approvalId = (_u = (_t = output.providerOptions) == null ? void 0 : _t.openai) == null ? void 0 : _u.approvalId;
3082
3082
  if (approvalId) {
3083
3083
  continue;
3084
3084
  }
@@ -3152,7 +3152,7 @@ async function convertToOpenAIResponsesInput({
3152
3152
  outputValue = output.value;
3153
3153
  break;
3154
3154
  case "execution-denied":
3155
- outputValue = (_u = output.reason) != null ? _u : "Tool execution denied.";
3155
+ outputValue = (_v = output.reason) != null ? _v : "Tool execution denied.";
3156
3156
  break;
3157
3157
  case "json":
3158
3158
  case "error-json":
@@ -3213,7 +3213,7 @@ async function convertToOpenAIResponsesInput({
3213
3213
  contentValue = output.value;
3214
3214
  break;
3215
3215
  case "execution-denied":
3216
- contentValue = (_v = output.reason) != null ? _v : "Tool execution denied.";
3216
+ contentValue = (_w = output.reason) != null ? _w : "Tool execution denied.";
3217
3217
  break;
3218
3218
  case "json":
3219
3219
  case "error-json":