@zenning/openai 3.0.13 → 3.0.15

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.
@@ -2475,10 +2475,8 @@ async function convertToOpenAIResponsesInput({
2475
2475
  const input = [];
2476
2476
  const warnings = [];
2477
2477
  const processedApprovalIds = /* @__PURE__ */ new Set();
2478
- const hasApprovalResponses = prompt.some(
2479
- (message) => message.role === "tool" && message.content.some((part) => part.type === "tool-approval-response")
2480
- );
2481
- console.log("[OpenAI Provider] Approval continuation detected:", hasApprovalResponses);
2478
+ const skipItemReferences = (providerOptionsName && (store == null ? void 0 : store.skipItemReferencesForApproval)) === true;
2479
+ console.log("[OpenAI Provider] Skip item references flag:", skipItemReferences);
2482
2480
  if (compactionInput && compactionInput.length > 0) {
2483
2481
  input.push(...compactionInput);
2484
2482
  }
@@ -2573,29 +2571,31 @@ async function convertToOpenAIResponsesInput({
2573
2571
  }
2574
2572
  case "tool-call": {
2575
2573
  const id = (_g = (_d = (_c = part.providerOptions) == null ? void 0 : _c[providerOptionsName]) == null ? void 0 : _d.itemId) != null ? _g : (_f = (_e = part.providerMetadata) == null ? void 0 : _e[providerOptionsName]) == null ? void 0 : _f.itemId;
2576
- const skipItemReference = hasApprovalResponses;
2577
2574
  console.log("[OpenAI Provider] Processing tool-call:", {
2578
2575
  toolCallId: part.toolCallId,
2579
2576
  toolName: part.toolName,
2580
2577
  id,
2581
2578
  providerExecuted: part.providerExecuted,
2582
2579
  store,
2583
- hasApprovalResponses,
2584
- skipItemReference,
2585
- willCreateItemReference: store && id != null && !skipItemReference
2580
+ skipItemReferences,
2581
+ willCreateItemReference: store && id != null && !skipItemReferences
2586
2582
  });
2587
2583
  if (part.providerExecuted) {
2588
- if (store && id != null && !skipItemReference) {
2584
+ if (store && id != null && !skipItemReferences) {
2589
2585
  console.log("[OpenAI Provider] Creating item_reference (providerExecuted)");
2590
2586
  input.push({ type: "item_reference", id });
2591
2587
  }
2592
2588
  break;
2593
2589
  }
2594
- if (store && id != null && !skipItemReference) {
2590
+ if (store && id != null && !skipItemReferences) {
2595
2591
  console.log("[OpenAI Provider] Creating item_reference (non-providerExecuted)");
2596
2592
  input.push({ type: "item_reference", id });
2597
2593
  break;
2598
2594
  }
2595
+ if (skipItemReferences) {
2596
+ console.log("[OpenAI Provider] Skipping function_call due to approval continuation flag");
2597
+ break;
2598
+ }
2599
2599
  const resolvedToolName = toolNameMapping.toProviderToolName(
2600
2600
  part.toolName
2601
2601
  );